Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reinstate, but deprecate, the 'sleep' input #210

Merged
merged 4 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,12 @@ All input names in **bold** are _required_.
| `acceptable_conclusions` | A comma-separated list of acceptable statuses. If any of these statuses are present, the action will not fail.</br></br>See the [GitHub REST API documentation](https://docs.github.com/en/rest/actions/workflow-jobs#get-a-job-for-a-workflow-run), specifically, the Response schema's "conclusion" property's `enum` values, for a complete list of supported values (excluding `null`). | `success` |
| `fail_fast` | If set to true, the action will fail as soon as a check fails. If set to false (default), the action will wait for all checks to complete before failing. | `False` |

### Deprecated inputs

| Name | Replaced by | Deprecated since |
|:---:|:---:|:---:|
| `sleep` | `pre_sleep` | v2.15.0 |

## License

All files in this repository is licensed under the [MIT License](LICENSE) and copyright &copy; Casper Welzel Andersen.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ inputs:
description: 'If set to true, the action will fail as soon as a check fails. If set to false (default), the action will wait for all checks to complete before failing.'
required: false
default: 'false'

# DEPRECATED
sleep:
description: "DEPRECATED! Use 'pre_sleep'. Time (in seconds) the action should wait until it will start 'waiting' and check the list of running actions/checks. This should be an appropriate number to let the checks start up"
required: false
default: ''
runs:
using: 'docker'
image: 'Dockerfile'
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ esac

set -e

if [ -n "${INPUT_SLEEP}" ]; then
echo "::warning title=Deprecated input::The 'sleep' input is deprecated. Please use 'pre_sleep' instead."
if [ -z "${INPUT_PRE_SLEEP}" ] || [ "${INPUT_PRE_SLEEP}" == "5" ]; then
# If `pre_sleep` is not defined, or is the default value, use the deprecated `sleep` input value
INPUT_PRE_SLEEP=${INPUT_SLEEP}
fi
fi

# Utility functions
ere_quote() {
sed 's/[][\.|$(){}?+*^]/\\&/g' <<< "$*"
Expand Down