/action-job-status

✅ The missing status check utility for GitHub workflow runs.

Primary LanguageTypeScriptMIT LicenseMIT

action-job-status: GitHub Workflow Job Status

demo

A workflow triggered by certain events, such as workflow_run status, runs on the default branch. Consequently, its job statuses are not attached to the initial commit that triggered the chain of events.

This action reports the job status back to the initial commit in the form of a commit status.

Usage

Add ushuz/action-job-status@v1 as the first step in a job:

name: Validate
on:
  workflow_run:
    workflows: ["test"]
    types:
      - completed

jobs:
  post-test-success:
    runs-on: ubuntu-latest
    steps:
      - uses: ushuz/action-job-status@v1
      - uses: actions/checkout@v3
      - run: exit 0

  post-test-failure:
    runs-on: ubuntu-latest
    steps:
      - uses: ushuz/action-job-status@v1
      - uses: actions/checkout@v3
      - run: exit 1

The action requires at minimum the following permissions:

permissions:
  actions: read
  statuses: write