Skip to content

Commit

Permalink
Reinstate, but deprecate, the 'sleep' input (#210)
Browse files Browse the repository at this point in the history
A deprecation warning is emitted if the 'sleep' input is
specified.

The value will still be used, but only if pre_sleep is either not
defined or is equal to its default value.
sleep's default value has been reset to an empty string (used
to be '5').
  • Loading branch information
CasperWA authored Nov 2, 2023
1 parent 5ebcfba commit 22ba026
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
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

0 comments on commit 22ba026

Please sign in to comment.