Skip to content

Legytma/gitea-wait-for-checks

Repository files navigation

gitea-wait-for-checks

Check Transpiled JavasScript GitHub Super-Linter CI CodeQL Coverage Release Release

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.

Minimal example

.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
      ...

Using Workflow Name

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
      ...

Using Job Name

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
      ...

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.

About

Action to Wait Checks using Gitea API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •