From 65a17715d67c2ead8e406fe89b10824e2a237c66 Mon Sep 17 00:00:00 2001 From: Wibus Wu <62133302+wibus-wee@users.noreply.github.com> Date: Thu, 27 Aug 2026 08:42:26 +0000 Subject: [PATCH] fix: preserve PR body enforcement outcome Model: gpt-5 --- .github/AGENTS.md | 3 +++ .github/workflows/pr-body.yml | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/AGENTS.md b/.github/AGENTS.md index d7280caba..99fa53783 100644 --- a/.github/AGENTS.md +++ b/.github/AGENTS.md @@ -30,3 +30,6 @@ - Workflows triggered by `pull_request_target` have a write-capable token. They must never check out the pull request head or execute files supplied by the pull request. Read scripts and configuration from the base commit only. +- PR-body comments require pull-request write permission. Treat comment creation, + updates, and cleanup as best-effort feedback; the checker result alone decides + whether the enforcement job passes or fails. diff --git a/.github/workflows/pr-body.yml b/.github/workflows/pr-body.yml index 1d50cae69..c07ef1b69 100644 --- a/.github/workflows/pr-body.yml +++ b/.github/workflows/pr-body.yml @@ -7,7 +7,7 @@ on: permissions: contents: read issues: write - pull-requests: read + pull-requests: write concurrency: group: pr-body-${{ github.event.pull_request.number }} @@ -48,6 +48,7 @@ jobs: - name: Notify author on format failure if: steps.validate.outputs.code != '0' + continue-on-error: true uses: actions/github-script@v7 env: FINDINGS_FILE: ${{ runner.temp }}/pr-body-check.txt @@ -102,6 +103,7 @@ jobs: - name: Clear format failure comment on success if: steps.validate.outputs.code == '0' + continue-on-error: true uses: actions/github-script@v7 with: script: | @@ -122,5 +124,5 @@ jobs: } - name: Fail when the body is invalid - if: steps.validate.outputs.code != '0' + if: always() && steps.validate.outputs.code != '0' run: exit 1