From 3df67a3cabf2448ccf102c6e7a3e7552bcbadff5 Mon Sep 17 00:00:00 2001 From: tg-autopilot Date: Thu, 10 Sep 2026 10:53:02 +0545 Subject: [PATCH 1/2] feat: skip pr-build-zip on a re-push unless the commit mentions #build-zip Actions minutes were increasing since every push to an open PR rebuilds the full ZIP. Splits the single job into a cheap gate job (checks the pushed commit's message) and the actual build job, gated on the gate job's output. Opened/reopened/ready_for_review PRs and manual dispatch always build -- only a follow-up push (synchronize) needs #build-zip in the commit message. This reverses a documented Phase 1 decision against commit-message gating (see SETUP.md's Design notes) -- that tradeoff (discoverability) is being accepted now specifically to cut Actions minutes. --- .github/workflows/pr-build-zip.yml | 35 ++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-build-zip.yml b/.github/workflows/pr-build-zip.yml index be70472..66641c1 100644 --- a/.github/workflows/pr-build-zip.yml +++ b/.github/workflows/pr-build-zip.yml @@ -108,8 +108,8 @@ concurrency: cancel-in-progress: true jobs: - build: - name: Build ZIP and comment + gate: + name: Check trigger conditions # Skip drafts, but always run a manual dispatch. Skip fork PRs too: forks # never get repo secrets, so BOT_TOKEN/ARTIFACTS_* are unset and the job # would just fail loudly on the upload/comment steps. @@ -118,6 +118,37 @@ jobs: (github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) runs-on: ubuntu-latest + outputs: + proceed: ${{ steps.decide.outputs.proceed }} + steps: + # Always build on open/reopen/ready-for-review (and non-PR triggers, + # e.g. workflow_dispatch) -- only a follow-up push needs the marker. + # Checked here, not as a job-level `if:`, since it needs the actual + # commit message, which isn't in the pull_request event payload. + - name: Decide whether to build + id: decide + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPO: ${{ github.repository }} + SHA: ${{ github.event.pull_request.head.sha || github.sha }} + run: | + if [ "${{ github.event_name != 'pull_request' || github.event.action != 'synchronize' }}" = "true" ]; then + echo "proceed=true" >> "$GITHUB_OUTPUT" + exit 0 + fi + MESSAGE=$(gh api "repos/$REPO/commits/$SHA" --jq '.commit.message') + if echo "$MESSAGE" | grep -qi '#build-zip'; then + echo "proceed=true" >> "$GITHUB_OUTPUT" + else + echo "proceed=false" >> "$GITHUB_OUTPUT" + echo "::notice::Skipping build -- commit message has no #build-zip. Push again with it in the message (or comment/reopen) to force a rebuild." + fi + + build: + name: Build ZIP and comment + needs: gate + if: needs.gate.outputs.proceed == 'true' + runs-on: ubuntu-latest steps: # Explicit ref: without it, a pull_request event checks out GitHub's # synthetic merge commit, not the PR's own head -- and we label the zip From 54917f3b78dc8a16afcb7b31e53d83808e475d10 Mon Sep 17 00:00:00 2001 From: tg-autopilot Date: Thu, 10 Sep 2026 10:53:45 +0545 Subject: [PATCH 2/2] docs: mention the #build-zip convention in the build comment itself --- .github/workflows/pr-build-zip.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr-build-zip.yml b/.github/workflows/pr-build-zip.yml index 66641c1..9aaf458 100644 --- a/.github/workflows/pr-build-zip.yml +++ b/.github/workflows/pr-build-zip.yml @@ -317,6 +317,8 @@ jobs: Installs directly via **Plugins → Add New → Upload Plugin**. Link expires in ${{ inputs.retention-days }} days · updated ${{ steps.stamp.outputs.at }} + A later push only rebuilds this if its commit message includes `#build-zip`. + - name: Run summary run: | {