Skip to content

marocchino/action-workflow_run-status

 
 

Repository files navigation

action-workflow_run-status

workflow_run status demo

This action updates commit status of a original commit which triggerred workflow_run workflow.

Workflow triggered by workflow_run event runs on the default branch for the repository, so it's hard to track the status by default from the original commit even though it triggered the workflow. This action simply resolve this issue by updating commit status. You can check the status of workflow_run job and jump to the associated workflow page from the attached commit status.

Usage

Just add haya14busa/action-workflow_run-status@v1 as a first step of workflow jobs triggered by workflow_run event.

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

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

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

if your jobs using matrix you can send it's name for display like:

name: 'test_post'
on:
  workflow_run:
    workflows: ["test"]
    types:
      - completed
jobs:
  build:
    if: github.event.workflow_run.conclusion == 'success'
    runs-on: ubuntu-latest
    strategy:
      matrix:
        node_group:
          - "1"
          - "2"
    steps:
      - uses: actions/checkout@v3
      - uses: ./
        with:
        matrix_name: ${{ matrix.node_group }}
      - run: exit 0

About

✅ The missing status check utility for workflow_run action.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 93.8%
  • JavaScript 6.2%