ci!: set pr write perms on release-labels (#16380)

I'm pretty sure this is the fix, but I can't test it without merging it,
as `pull_request_target` causes the workflow to run using the workflow
on `main` (where the permissions aren't set).

This comment would seem to indicate that `pull_request_target` with PR
write perms does the trick:
https://github.com/actions/labeler/issues/136#issuecomment-1357839196

From what I can tell this job has been broken since ~nov '24, which
leads me to believe it was the permissions change made that month:
https://github.com/coder/coder/actions/runs/11915659159/job/33206435274
This commit is contained in:
Ethan
2025-02-03 20:49:37 +11:00
committed by GitHub
parent 8d8d41eaea
commit 8815b38c88
+2
View File
@@ -46,6 +46,8 @@ jobs:
release-labels:
runs-on: ubuntu-latest
permissions:
pull-requests: write
# Skip tagging for draft PRs.
if: ${{ github.event_name == 'pull_request_target' && !github.event.pull_request.draft }}
steps: