Skip to content

Commit

Permalink
Create an action to sleep on any platform
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Nied <petern@amazon.com>
  • Loading branch information
peternied authored Nov 8, 2022
1 parent 463c8ef commit 7472dd1
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
20 changes: 19 additions & 1 deletion README.md
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
```
22 changes: 22 additions & 0 deletions action.yml
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

0 comments on commit 7472dd1

Please sign in to comment.