From 065b8dea87aa1468741bb125990df27ad2ce11d7 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Thu, 10 Sep 2026 17:25:21 +0100 Subject: [PATCH] Add "Rebuild: Unchanged" label to PRs if rebuild workflow makes no changes --- .github/workflows/rebuild.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rebuild.yml b/.github/workflows/rebuild.yml index faa32c65d..9f3a44de0 100644 --- a/.github/workflows/rebuild.yml +++ b/.github/workflows/rebuild.yml @@ -33,7 +33,7 @@ jobs: uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0 with: node-version: 24 - cache: 'npm' + cache: "npm" - name: Remove label if: github.event_name == 'pull_request' @@ -145,3 +145,14 @@ jobs: echo "Pushed a commit to rebuild the Action." \ "Please approve running the PR checks." | gh pr comment --body-file - --repo github/codeql-action "$PR_NUMBER" + + - name: "Add 'Rebuild: Unchanged' label" + if: >- + github.event_name == 'pull_request' && + steps.push.outputs.changes != 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + run: | + gh pr edit --repo github/codeql-action "$PR_NUMBER" \ + --add-label "Rebuild: Unchanged"