From 702d724e499074c779d2d8643762206b554edc4d Mon Sep 17 00:00:00 2001 From: chodeus <190988615+chodeus@users.noreply.github.com> Date: Wed, 4 Nov 2026 11:48:59 +0800 Subject: [PATCH] ci: report Lint + build on bundled-library PRs, where the dispatched run's checks never appear - A run dispatched for a PR (base set) posts the Lint + build result as a commit status on that commit - Without it the required check never reached the PR: CI on vendor-sync's push waits for approval, and dispatched checks stay off the PR - A failure in such a run is treated like a PR run and no longer posts to Discord --- .github/workflows/ci.yml | 23 ++++++++++++++++++++++- .github/workflows/vendor-sync.yml | 2 +- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 68548634..0b6e9edf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -120,9 +120,30 @@ jobs: python -m unittest discover -s .github/unraid-watch -p 'test_*.py' python .github/unraid-watch/watch.py check + # A dispatched run's checks never reach the PR, so vendor-sync's run reports Lint + build there as a commit status. + report: + needs: validate + if: always() && github.event_name == 'workflow_dispatch' && inputs.base != '' + runs-on: ubuntu-latest + permissions: + statuses: write + steps: + - name: Post the result on the PR's commit + env: + RESULT: ${{ needs.validate.result }} + GH_TOKEN: ${{ github.token }} + REPO: ${{ github.repository }} + SHA: ${{ github.sha }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + run: | + set -euo pipefail + state=failure + [ "$RESULT" = success ] && state=success + gh api "repos/$REPO/statuses/$SHA" -f state="$state" -f context='Lint + build' -f target_url="$RUN_URL" -f description="CI dispatched for this PR: $RESULT" >/dev/null + notify-failure: needs: validate - if: failure() && github.event_name != 'pull_request' + if: failure() && github.event_name != 'pull_request' && !inputs.base permissions: {} uses: chodeus/chodeus-ops/.github/workflows/notify-discord.yml@cbd544d21103cfe854c8e0ec717ee2be4f097ad7 # main with: diff --git a/.github/workflows/vendor-sync.yml b/.github/workflows/vendor-sync.yml index 5e79857f..d915fb55 100644 --- a/.github/workflows/vendor-sync.yml +++ b/.github/workflows/vendor-sync.yml @@ -42,7 +42,7 @@ jobs: echo "EOF" } >> "$GITHUB_OUTPUT" - # A push made with GITHUB_TOKEN starts no workflow, so the required check is dispatched by hand. + # CI on a GITHUB_TOKEN push waits for an approval nobody gives, so it is dispatched; ci.yml's report job posts the PR's status. - name: Commit and re-run the required check if: steps.sync.outputs.changed == 'true' env: