-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create an action to sleep on any platform
Signed-off-by: Peter Nied <petern@amazon.com>
- Loading branch information
Showing
2 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,20 @@ | ||
# action-sleep | ||
Platform independent GitHub Action to Sleep | ||
GitHub Action to Sleep that works on a multi-platform runners | ||
|
||
Thanks to https://github.com/jakejarvis/wait-action for inspiring this action | ||
|
||
```yaml | ||
inputs: | ||
seconds: | ||
description: 'The number of seconds to sleep' | ||
required: true | ||
``` | ||
## Usage: | ||
```yaml | ||
steps: | ||
- uses: peternied/action-sleep@v1 | ||
with: | ||
seconds: 30 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Sleep' | ||
|
||
description: 'Sleeps for an amount of seconds' | ||
|
||
inputs: | ||
seconds: | ||
description: 'The number of seconds to sleep' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
|
||
- name: Sleep (for Non-Windows) | ||
if: ${{ runner.os != 'Windows'}} | ||
run: sleep ${{ inputs.seconds }}s | ||
shell: bash | ||
|
||
- name: Sleep (for Windows) | ||
if: ${{ runner.os == 'Windows'}} | ||
run: Start-Sleep -s ${{ inputs.seconds }} | ||
shell: pwsh |