This action was inspired on lewagon/wait-on-check-action. And is writed in JavaScript to work on Gitea Actions.
Pause a workflow until a job in another workflow completes successfully.
This action uses the Gitea API (Get a commit's statuses) to poll for check results. On success, the action exit allowing the workflow resume. Otherwise, the action will exit with status code 1 and fail the whole workflow.
This is a workaround to Gitea Action's limitation of non-interdependent workflows 🎉
You can run your workflows in parallel and pause a job until a job in another workflow completes successfully.
.gitea/workflows/test.yaml
name: Test
on: [push]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
....gitea/workflows/push.yaml
name: Publish
on: [push]
jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: Legytma/gitea-wait-for-checks@v1.1.1
...Each workflow name must be on one line.
.gitea/workflows/push.yaml
name: Publish
on: [push]
jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: Legytma/gitea-wait-for-checks@v1.1.1
with:
workflow-names: |-
Test
...Each workflow name must be on one line.
.gitea/workflows/push.yaml
name: Publish
on: [push]
jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: Legytma/gitea-wait-for-checks@v1.1.1
with:
job-names: |-
Run tests
...As it could be seen in many examples, there's a parameter wait-interval, and
sets a time in seconds to be waited between requests to the GitHub API. The
default time is 10 seconds.