From fc24598af936a0188707383bd74db2a8c75a854f Mon Sep 17 00:00:00 2001 From: m96-chan Date: Tue, 15 Sep 2026 10:02:26 +0900 Subject: [PATCH] fix(ci): build on a push instead of asking for a pull request that is not there main has been red on every push since #38. The `scope` job reads the changed files from `repos/OWNER/REPO/pulls/NUMBER/files`, and on a push event `github.event.pull_request.number` is empty, so the request goes to `/pulls//files` and comes back 404. `scope` fails, every job that needs it is skipped, and the `ios` check reports the failure. #37 added `scope` for pull requests and #38 added the push trigger. Each was green on its own; the combination was never run before it was on main. A push has nothing to skip anyway. What reached main is worth building, and that run is the only thing that reports on it now that the required check cannot. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea6a493..4b5ab5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,15 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + # A push has no pull request to read a file list from — `pull_request.number` is empty + # and the request goes to `/pulls//files`, which is a 404 and took main red on every + # push. There is also nothing to skip there: whatever reached main is worth building, + # and this run is the only thing that reports on it. + if [ "${{ github.event_name }}" != "pull_request" ]; then + echo "Not a pull request; building." + echo "build=true" >> "$GITHUB_OUTPUT" + exit 0 + fi files=$(gh api "repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files" \ --paginate --jq '.[].filename') printf 'Changed files:\n%s\n' "$files"