I have 2 workflows in my repository:
name: First
on:
pull_request:
branches: [ master ]
jobs:
test:
name: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
- name: Test
run: go test -v ./...
and
name: Second
on:
workflow_run:
workflows: ["First"]
types:
- completed
jobs:
golangci:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
The second workflow is launched only when the first workflow successfully completes. This part works.
I have set branch rules so that any pull request on "master" must have these 2 workflows pass. When I make/update a PR both the workflows run as expected. However the PR never detects that the 2nd workflow has run.. it gets stuck in the "Expected — Waiting for status to be reported" state.
I assume this is because the 2nd workflow is not triggered by a pull request, but by the previous workflow. Is there a way I can make my 2nd workflow notify the correct pull request that it has completed?
(this is a trivial example that illustrates a problem that occurs on a much larger repository with multiple workflows, it would not be ideal to have all jobs in one workflow in the large repo).
Thanks
with: ref: ${{ github.event.workflow_run.head_branch }}
or${{ github.event.workflow_run.head_sha }}
but nothing seems to work either – Turnabout