From b90a0d0ba629bff363796188db3b72e844706c1b Mon Sep 17 00:00:00 2001 From: Stephan Merker Date: Wed, 22 Jul 2026 15:20:09 +0200 Subject: [PATCH] Fix fork-integration-status-reporter workflow - how to access workflow_dispatch inputs - more complete handling of job status --- .../fork-integration-status-reporter.yml | 30 +++++++------------ 1 file changed, 11 insertions(+), 19 deletions(-) diff --git a/.github/workflows/fork-integration-status-reporter.yml b/.github/workflows/fork-integration-status-reporter.yml index a26469bb..0e184b35 100644 --- a/.github/workflows/fork-integration-status-reporter.yml +++ b/.github/workflows/fork-integration-status-reporter.yml @@ -13,40 +13,32 @@ on: permissions: statuses: write -env: - GH_TOKEN: ${{ github.token }} - jobs: report: name: Report status runs-on: ubuntu-latest - # Only fork-triggered runs use workflow_dispatch; skip push/pull_request runs entirely - if: github.event.workflow_run.event == 'workflow_dispatch' + # Only fork-triggered IT runs use workflow_dispatch; skip push/pull_request runs entirely + if: github.event.workflow_run.event == 'workflow_dispatch' && github.event.workflow_run.inputs.pr_ref != '' + env: + GH_TOKEN: ${{ github.token }} steps: - - name: Get pr_ref from triggering run - id: inputs - run: | - pr_ref=$(gh run view ${{ github.event.workflow_run.id }} \ - --repo "$GITHUB_REPOSITORY" --json inputs \ - --jq '.inputs.pr_ref // empty') - echo "pr_ref=$pr_ref" >> $GITHUB_OUTPUT - - name: Post commit status per job - if: steps.inputs.outputs.pr_ref != '' run: | - pr_ref="${{ steps.inputs.outputs.pr_ref }}" + pr_ref="${{ github.event.workflow_run.inputs.pr_ref }}" gh run view ${{ github.event.workflow_run.id }} \ --repo "$GITHUB_REPOSITORY" --json jobs \ --jq '.jobs[] | [.name, .conclusion, .url] | @tsv' \ | while IFS=$'\t' read -r name conclusion url; do case "$conclusion" in - success) state="success" ;; - cancelled) state="error" ;; - *) state="failure" ;; + success) state="success" ;; + cancelled|timed_out) state="error" ;; + skipped) continue ;; + *) state="failure" ;; esac gh api --method POST "repos/$GITHUB_REPOSITORY/statuses/$pr_ref" \ -f state="$state" \ -f context="$name" \ -f target_url="$url" \ - -f description="$conclusion" + -f description="$conclusion" & done + wait