From 8609f23c3369b2a9c2821911743f3726599af594 Mon Sep 17 00:00:00 2001 From: josc146 Date: Sat, 4 Mar 2023 15:30:33 +0800 Subject: [PATCH] update readme --- README.md | 41 +++++++++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index ff9e1ed..c864d51 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,11 @@ # Get Current Time Github Action -This action sets the current ISO8601 time to the `time` output and also provides `readableTime`, `formattedTime`, and many more digital outputs like `year`, `day`, `second`, etc. Useful for setting build times in subsequent steps, renaming your artifact, or keeping the same recorded time for the entire workflow. +This action sets the current ISO8601 time to the `time` output and also provides `readableTime`, `formattedTime`, and +many more digital outputs like `year`, `day`, `second`, etc. Useful for setting build times in subsequent steps, +renaming your artifact, or keeping the same recorded time for the entire workflow. + +You can view some typical input/output in the [action.test.js](./action.test.js) file. ## Inputs @@ -20,6 +24,11 @@ Time format to use - using [MomentJS format syntax](https://momentjs.com/docs/#/ UTC offset to use - using [MomentJS utcOffset syntax](https://momentjs.com/docs/#/manipulating/utc-offset/) - optional +### `timezone` + +Timezone to use - check [moment-timezone list](https://gist.github.com/diogocapela/12c6617fc87607d11fd62d2a4f42b02a) - +optional, if set, utcOffset will be ignored, e.g. "America/Los_Angeles" + ## Outputs ### `time` @@ -70,6 +79,14 @@ steps: npm install ``` +### Build + +``` +npm start +``` + +And you'll see the index.js is generated in the dist folder + ### Test ``` @@ -83,17 +100,16 @@ And you'll see the console output as following: **PASS** ./action.test.js   action - -     **√** Should load (1 ms) -     **√** Should run with basic functionality (1 ms) +    **√** Should load (1 ms) -     **√** Should run with other basic outputs (1 ms) +    **√** Should correctly set outputs (1 ms) -     **√** Should pass format inputs (1 ms) +    **√** Should correctly set outputs with utcOffset (1 ms) -     **√** Should throw error (1 ms) +    **√** Should correctly set outputs with timezone (1 ms) +    **√** Should throw error (1 ms) | File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | |-----------------|--------------|---------------|--------------|--------------|-----------------------------| @@ -112,14 +128,7 @@ Ran all test suites. *** -### Build - -``` -npm start -``` - -And you'll see the index.js is generated in the dist folder - ## Credit -This project is forked from [srfrnk/current-time](https://github.com/srfrnk/current-time) and detached since 14 December of 2022 +This project is forked from [srfrnk/current-time](https://github.com/srfrnk/current-time) and detached since 14 December +of 2022