Skip to content

Commit c38ba3f

Browse files
authored
Merge pull request #1270 from PolicyEngine/fix/pr-edit-permissions
Fix PR edit permission error in weekly update workflow
2 parents 4525be6 + 1628030 commit c38ba3f

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

.github/scripts/create_pr.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ EXISTING_PR=$(gh pr list --head "$BRANCH_NAME" --json number --jq '.[0].number'
4141

4242
if [ -n "$EXISTING_PR" ]; then
4343
echo "PR #$EXISTING_PR already exists, updating it"
44-
gh pr edit "$EXISTING_PR" --body "$PR_BODY"
44+
# Use REST API instead of gh pr edit to avoid GraphQL read:org scope requirement
45+
gh api --method PATCH "/repos/{owner}/{repo}/pulls/$EXISTING_PR" -f body="$PR_BODY"
4546
else
4647
echo "Creating new PR"
4748
gh pr create \

changelog_entry.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
- bump: patch
2+
changes:
3+
fixed:
4+
- Fix PR edit permission error in weekly update workflow by using REST API instead of GraphQL.

0 commit comments

Comments
 (0)