https://github.com/legytma/gitea-wait-for-checks
Action to Wait Checks using Gitea API
https://github.com/legytma/gitea-wait-for-checks
Last synced: 4 months ago
JSON representation
Action to Wait Checks using Gitea API
- Host: GitHub
- URL: https://github.com/legytma/gitea-wait-for-checks
- Owner: Legytma
- License: apache-2.0
- Created: 2024-03-14T20:09:37.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-08-26T21:38:52.000Z (10 months ago)
- Last Synced: 2025-01-03T01:22:21.759Z (5 months ago)
- Language: JavaScript
- Size: 909 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# gitea-wait-for-checks

[](https://github.com/super-linter/super-linter)




**_This action was inspired on
[lewagon/wait-on-check-action](https://github.com/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)](https://docs.gitea.com/api/1.21/#tag/repository/operation/repoListStatuses)
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 :tada:You can **run your workflows in parallel** and pause a job until a job in
another workflow completes successfully.## Minimal example
`.gitea/workflows/test.yaml`
```yml
name: Teston: [push]
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
steps:
...
````.gitea/workflows/push.yaml`
```yml
name: Publishon: [push]
jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: Legytma/[email protected]
...
```### Using Workflow Name
Each workflow name must be on one line.
`.gitea/workflows/push.yaml`
```yml
name: Publishon: [push]
jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: Legytma/[email protected]
with:
workflow-names: |-
Test
...
```### Using Job Name
Each workflow name must be on one line.
`.gitea/workflows/push.yaml`
```yml
name: Publishon: [push]
jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: Legytma/[email protected]
with:
job-names: |-
Run tests
...
```### Wait interval (optional, default: 10)
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.