From 4d90c4d3bad237f726f8eed98857b3f2b9af3a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=BC=ED=98=81?= Date: Sun, 13 Sep 2026 18:31:39 +0900 Subject: [PATCH] =?UTF-8?q?fix(platform):=20=EC=8A=A4=ED=83=9D=20=EC=95=88?= =?UTF-8?q?=EB=82=B4=20=EC=BD=94=EB=A9=98=ED=8A=B8=EC=97=90=20pull-request?= =?UTF-8?q?s=20=EC=93=B0=EA=B8=B0=20=EA=B6=8C=ED=95=9C=EC=9D=84=20?= =?UTF-8?q?=EC=A4=80=EB=8B=A4=20(#2068)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit notify-affected-pull-requests job 이 코멘트를 남기는 대상은 언제나 PR 이다. GitHub 은 issues/{n}/comments 의 필요 스코프를 대상 타입으로 가르므로 PR 에 쓰려면 pull-requests 쓰기가 필요하다. read 로 두면 목록 GET 은 통과하고 첫 POST 에서 403 이 나 스택 상위 PR 안내가 통째로 막힌다. merge-order-guard-policy.test.mjs 는 issues 쓰기만 계약으로 박아 두고 pull-requests 칸은 비워 뒀다. 그 빈칸이 read 로 머문 채 머지된 경로라 같은 자리에 단언을 더한다. 권한을 read 로 되돌리면 그 테스트가 실패한다. --- .github/scripts/merge-order-guard-policy.test.mjs | 3 +++ .github/workflows/stack-integrity-notify.yml | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/scripts/merge-order-guard-policy.test.mjs b/.github/scripts/merge-order-guard-policy.test.mjs index 188603b709..6aa57dae00 100644 --- a/.github/scripts/merge-order-guard-policy.test.mjs +++ b/.github/scripts/merge-order-guard-policy.test.mjs @@ -263,6 +263,9 @@ test("declares the repository code owner for GitHub automation and policy change test("live CLOSED warns upper PRs while OPEN or MERGED resolves the same bot comment", () => { assert.match(stackNotify, /issues: write/); + // 코멘트 대상이 PR 이면 GitHub 은 pull-requests 쓰기를 요구한다. 이 칸이 read 로 + // 머물러 안내 코멘트가 403 으로 죽은 적이 있다(#2068). + assert.match(stackNotify, /pull-requests: write/); assert.match(stackNotify, /live_state=\$\(jq -r '\.state'/); assert.match(stackNotify, /CLOSED\)[\s\S]*notice_state="active"/); assert.match(stackNotify, /OPEN\)[\s\S]*notice_state="resolved"/); diff --git a/.github/workflows/stack-integrity-notify.yml b/.github/workflows/stack-integrity-notify.yml index e2158b88ac..b6c3a6e9e9 100644 --- a/.github/workflows/stack-integrity-notify.yml +++ b/.github/workflows/stack-integrity-notify.yml @@ -21,7 +21,10 @@ jobs: permissions: contents: read issues: write - pull-requests: read + # 이 job 이 코멘트를 남기는 대상은 언제나 PR 이다. GitHub 은 issues/{n}/comments 의 + # 필요 스코프를 대상 타입으로 가르기 때문에 PR 에 쓰려면 pull-requests 쓰기가 있어야 한다. + # read 로 두면 목록 GET 은 통과하고 첫 POST 에서 403 이 난다(#2068). + pull-requests: write steps: - name: Clone stack policy from the default branch uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1