Skip to content

fix(ci): Draft PR Label Cleanup workflow lacks pull-requests: write, label removal 403s #2592

Description

@exploreriii

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: readpull-requests: write in .github/workflows/draft-label-cleanup.yml.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Good First IssueIssues which are ideal for a first time or new project contributor.approvedIssue has been approved by team member

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions