Skip to content

fix(ci): grant contributors workflow permission to open PRs#56

Merged
mohanagy merged 1 commit intomainfrom
chore/fix-contributors-workflow-permissions
May 5, 2026
Merged

fix(ci): grant contributors workflow permission to open PRs#56
mohanagy merged 1 commit intomainfrom
chore/fix-contributors-workflow-permissions

Conversation

@mohanagy
Copy link
Copy Markdown
Owner

@mohanagy mohanagy commented May 5, 2026

Summary

  • The Update contributors workflow failed on its first run after #55 merged to main, with Resource not accessible by integration.
  • Root cause: branch protection on main triggers the action's auto_detect_branch_protection fallback (open a PR instead of pushing directly), but the workflow only had contents: write — it lacked pull-requests: write.
  • This PR adds pull-requests: write to the workflow permissions block.

Repo-level setting also flipped

The repo-level switch "Allow GitHub Actions to create and approve pull requests" was previously off (can_approve_pull_request_reviews: false). It has been enabled — without that, no per-workflow pull-requests: write can take effect.

Both conditions are now in place:

  • Repo: can_approve_pull_request_reviews: true
  • Workflow: pull-requests: write (this PR)

Test plan

  • CI passes on this PR
  • After merge to main: Update contributors workflow runs successfully and opens a docs(contributor): contributors readme action update PR with the populated HTML table for @mohanagy and @jamemackson
  • That auto-generated PR is merged, populating the README contributors section in main
  • After both are landed, tag v0.11.0 from main so the npm package ships with a real contributors table

Notes

  • The orphaned side branch contributors-readme-action-e8pGzCw-Ox left by the failed first run has already been deleted.
  • This is a follow-up to #55 — the actual v0.11.0 tag is held until this lands and the contributors table is populated.

Summary by CodeRabbit

  • Chores
    • Updated GitHub Actions workflow permissions to support additional automation capabilities.

The first run of Update contributors on main failed with
"Resource not accessible by integration" because the action's
auto_detect_branch_protection logic detected the protection on main,
fell back to opening a PR with the regenerated table, and the
workflow's GITHUB_TOKEN lacked pull-requests:write.

Repo-level "Allow GitHub Actions to create and approve pull requests"
has also been enabled (can_approve_pull_request_reviews=true). With
both in place the action can now open the docs(contributor) PR
instead of pushing directly to main.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 5, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8065299e-6f65-438c-a221-7dabd094223a

📥 Commits

Reviewing files that changed from the base of the PR and between eaf2c1a and 579a65a.

📒 Files selected for processing (1)
  • .github/workflows/contributors.yml

📝 Walkthrough

Walkthrough

The PR adds pull-requests: write permission to the GitHub Actions contributors workflow, granting it the ability to write to pull requests alongside its existing content write access.

Changes

Workflow Permissions Update

Layer / File(s) Summary
Workflow Permissions
.github/workflows/contributors.yml
Adds pull-requests: write permission to the permissions block, enabling pull request write access in the workflow.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

  • mohanagy/graphify-ts#55: Introduces the contributors workflow and initially sets contents: write permission; this PR extends those permissions with pull-requests: write.

Poem

🐰 A tiny hop, one line to add,
PR permissions? Never sad!
Now the workflow can comment with grace,
On pull requests across the place! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: granting the contributors workflow the pull-requests permission to enable PR creation.
Description check ✅ Passed The description provides detailed context, root cause analysis, and a comprehensive test plan, though the Testing section lacks the standard checklist items from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/fix-contributors-workflow-permissions

Comment @coderabbitai help to get the list of available commands and usage tips.

@mohanagy mohanagy merged commit a2fc37b into main May 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant