Skip to content

Commit 33c378e

Browse files
fix(validate-pr): Remove draft enforcement from composite action
The `convertPullRequestToDraft` GraphQL mutation requires permissions that the SDK Maintainer Bot app does not have, causing the action to fail on non-draft PRs. Remove the draft conversion and labeling steps entirely rather than expanding the app's permissions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c8116f commit 33c378e

File tree

3 files changed

+3
-83
lines changed

3 files changed

+3
-83
lines changed

validate-pr/README.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ Validates non-maintainer pull requests against contribution guidelines.
44

55
## What it does
66

7-
1. **Validates issue references** — Non-maintainer PRs must reference a GitHub issue where the PR author and a maintainer have discussed the approach. PRs that don't meet this requirement are automatically closed with a descriptive comment.
8-
2. **Enforces draft status** — All PRs must start as drafts. Non-draft PRs are automatically converted and labeled.
7+
**Validates issue references** — Non-maintainer PRs must reference a GitHub issue where the PR author and a maintainer have discussed the approach. PRs that don't meet this requirement are automatically closed with a descriptive comment.
98

10-
Maintainers (users with `admin` or `maintain` role) are exempt from the issue reference validation. Draft enforcement applies to everyone.
9+
Maintainers (users with `admin` or `maintain` role) are exempt from validation.
1110

1211
## Usage
1312

@@ -61,10 +60,6 @@ A PR is valid if **any** referenced issue passes all checks:
6160
- If the issue has assignees, the PR author must be one of them
6261
- Both the PR author and a maintainer have participated in the issue discussion
6362

64-
### Draft enforcement
65-
66-
Non-draft PRs are converted to draft and labeled `converted-to-draft` with an informational comment.
67-
6863
## Labels
6964

7065
The action creates these labels automatically (they don't need to exist beforehand):
@@ -73,4 +68,3 @@ The action creates these labels automatically (they don't need to exist beforeha
7368
- `missing-issue-reference` — PR body has no issue references
7469
- `missing-maintainer-discussion` — referenced issue lacks author + maintainer discussion
7570
- `issue-already-assigned` — referenced issue is assigned to someone else
76-
- `converted-to-draft` — PR was automatically converted to draft

validate-pr/action.yml

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: 'Validate PR'
2-
description: 'Validates non-maintainer PRs against contribution guidelines and enforces draft status'
2+
description: 'Validates non-maintainer PRs against contribution guidelines'
33
author: 'Sentry'
44

55
inputs:
@@ -33,26 +33,3 @@ runs:
3333
script: |
3434
const script = require('${{ github.action_path }}/scripts/validate-pr.js');
3535
await script({ github, context, core });
36-
37-
- name: Convert PR to draft
38-
if: >-
39-
steps.validate.outputs.was-closed != 'true'
40-
&& steps.validate.outputs.skipped != 'true'
41-
&& github.event.pull_request.draft == false
42-
shell: bash
43-
env:
44-
GH_TOKEN: ${{ steps.app-token.outputs.token }}
45-
PR_URL: ${{ github.event.pull_request.html_url }}
46-
run: gh pr ready "$PR_URL" --undo
47-
48-
- name: Label and comment on draft conversion
49-
if: >-
50-
steps.validate.outputs.was-closed != 'true'
51-
&& steps.validate.outputs.skipped != 'true'
52-
&& github.event.pull_request.draft == false
53-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
54-
with:
55-
github-token: ${{ steps.app-token.outputs.token }}
56-
script: |
57-
const script = require('${{ github.action_path }}/scripts/enforce-draft.js');
58-
await script({ github, context, core });

validate-pr/scripts/enforce-draft.js

Lines changed: 0 additions & 51 deletions
This file was deleted.

0 commit comments

Comments
 (0)