test-dispatch #46
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-repo-dispatch-listener | |
on: | |
repository_dispatch: | |
types: | |
- test-dispatch | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: {} | |
jobs: | |
assert: | |
name: "Assert Dispatch Event" | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
issues: write | |
statuses: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
- name: check client_payload | |
id: check_payload | |
run: | | |
if [[ -z "${{ github.event.client_payload.base.sha}}" ]]; then | |
echo ::error::no sha in client_payload | |
exit 1 | |
fi | |
if [[ "${{ github.event.client_payload.detail.jobname }}" != "test-dispatch" ]]; then | |
echo ::error::jobname not set to test-dispatch in client_payload | |
exit 1 | |
fi | |
- name: Check Status | |
id: check_outcome | |
if: | | |
(success() || failure()) && | |
github.event.client_payload.base.event_trigger == 'pull_request' | |
uses: ./commit-status-and-label | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
sha: ${{ github.event.client_payload.base.sha }} | |
state: "${{ steps.check_payload.outcome }}" |