Description
The Draft PR Label Cleanup workflow (added in #2573) fails with 403 Resource not accessible by integration when stripping queue labels from a PR converted to draft (e.g. run on PR #2332):
Cleaning draft PR #2332...
DELETE /repos/hiero-ledger/hiero-sdk-python/issues/2332/labels/queue%3Ajunior-committer - 403
Error: Failed to clean draft PR #2332: Resource not accessible by integration
Cause
.github/workflows/draft-label-cleanup.yml declares:
permissions:
issues: write
pull-requests: read
GitHub routes issues-API calls that target a pull request (like issues.removeLabel) through the pull-requests permission, so pull-requests: write is required. review-sync.yml performs the same operation successfully because it declares both.
Fix
Change pull-requests: read → pull-requests: write in .github/workflows/draft-label-cleanup.yml.
Description
The
Draft PR Label Cleanupworkflow (added in #2573) fails with 403 Resource not accessible by integration when stripping queue labels from a PR converted to draft (e.g. run on PR #2332):Cause
.github/workflows/draft-label-cleanup.ymldeclares:GitHub routes issues-API calls that target a pull request (like
issues.removeLabel) through the pull-requests permission, sopull-requests: writeis required.review-sync.ymlperforms the same operation successfully because it declares both.Fix
Change
pull-requests: read→pull-requests: writein.github/workflows/draft-label-cleanup.yml.