Skip to content

Commit ec222b4

Browse files
committed
use fine grained PAT
1 parent a45229b commit ec222b4

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/link-azip-to-discussion.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ name: Link AZIP to Discussion
1717
# parse it strictly.
1818
# * `discussions-to` values are validated against a strict regex before
1919
# any API call is made.
20+
# * Authenticates as `DISCUSSION_WRITE_TOKEN` (a fine-grained PAT scoped to
21+
# this repo with `discussions: write`) rather than `GITHUB_TOKEN`, because
22+
# org policy caps `GITHUB_TOKEN` to read-only and overrides the workflow
23+
# `permissions:` block. The PAT must be a *fine-grained* token limited to
24+
# this repository — do not use a classic PAT.
2025

2126
on:
2227
pull_request_target:
@@ -32,8 +37,6 @@ on:
3237

3338
permissions:
3439
contents: read
35-
pull-requests: read
36-
discussions: write
3740

3841
concurrency:
3942
group: link-azip-${{ github.event.pull_request.number || inputs.pr_number }}
@@ -43,7 +46,7 @@ jobs:
4346
link:
4447
runs-on: ubuntu-latest
4548
env:
46-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GH_TOKEN: ${{ secrets.DISCUSSION_WRITE_TOKEN }}
4750
REPO: ${{ github.repository }}
4851
PR_NUMBER: ${{ github.event.pull_request.number || inputs.pr_number }}
4952
steps:

0 commit comments

Comments
 (0)