Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omkarkhatavkar/wait-for-status-checks
GitHub Actions that waits for the GitHub Status API result and returns 'success' or 'failure'.
https://github.com/omkarkhatavkar/wait-for-status-checks
Last synced: 7 days ago
JSON representation
GitHub Actions that waits for the GitHub Status API result and returns 'success' or 'failure'.
- Host: GitHub
- URL: https://github.com/omkarkhatavkar/wait-for-status-checks
- Owner: omkarkhatavkar
- License: gpl-3.0
- Created: 2023-04-16T18:44:14.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-20T05:35:28.000Z (5 months ago)
- Last Synced: 2024-10-31T10:49:50.783Z (16 days ago)
- Language: Python
- Size: 414 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# wait-for-status-checks
This GitHub Action waits for a specified GitHub Status Check to complete before continuing the workflow. It uses the GitHub Status API to check the status of the specified context on the head commit of the current branch. The action will poll the API until the status is either "success", "failure", "not found", or until the specified timeout is reached.## Inputs
| Input | Description | Required| Default |
|---------------|----------------------------------------------|---------|---------|
| `ref` | Github commit head ref | Yes | ${{ github.head_ref }} |
| `context` | Context string to filter the statuses API | Yes | |
| `wait-interval`| Time to wait between polling (in seconds) | No | 300 |
| `count` | Number of times to poll before timing out | No | 12 |## outputs
| Output | Description |
|--------|-------------|
| result | `failure`, `success` or `not found` result of the status |## Example Usage
```yaml
name: Wait for Status Check
on: pushjobs:
wait_for_status:
runs-on: ubuntu-latest
steps:
- name: Wait for status check
id: outcome
uses: omkarkhatavkar/wait-for-status-checks@main
with:
ref: ${{ github.head_ref }}
context: 'continuous-integration/travis-ci/push'
wait-interval: 60
count: 10
- name: Check status
run: |
if [ ${{ steps.outcome.outputs.result }} == 'success' ]; then
echo "Status check passed!"
else
echo "Status check failed!"
fi
```