Skip to content

fix: use PAT to bypass branch protection for monthly activity - #26

Draft
waltergalvao wants to merge 2 commits into
mainfrom
cursor/workflow-pr-approach-0666
Draft

fix: use PAT to bypass branch protection for monthly activity#26
waltergalvao wants to merge 2 commits into
mainfrom
cursor/workflow-pr-approach-0666

Conversation

@waltergalvao

@waltergalvao waltergalvao commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

Updates the monthly activity workflow to use a Personal Access Token (PAT) to bypass branch protection rules and push directly to main.

Setup Required

Before this workflow will work, you need to:

  1. Create a PAT at https://github.com/settings/tokens

    • Classic token: select repo scope
    • Or fine-grained token: select this repo, grant "Contents" read+write
  2. Add yourself to the bypass list

    • Go to repo Settings → Rules → Rulesets (or Branch protection rules)
    • Edit the rule for main
    • Under "Bypass list" or "Allow specified actors to bypass required pull requests", add your GitHub username
  3. Add the PAT as a repo secret

    • Go to repo Settings → Secrets and variables → Actions
    • Create a new secret named ACTIVITY_PAT
    • Paste your PAT as the value

How it works

The workflow uses actions/checkout with your PAT token. When it pushes, GitHub sees the push as coming from you (the PAT owner), and since you're in the bypass list, it's allowed through.

Slack Thread

Open in Web Open in Cursor 

The workflow now creates a branch, pushes an empty commit to it,
and opens a PR instead of pushing directly to main. This works
around branch protection rules that require changes to go through PRs.

Auto-merge is attempted if enabled in repo settings.

Co-authored-by: Walter Galvao <waltergalvao@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 127f9e07-8030-4290-bcfc-9461393de855

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cursor/workflow-pr-approach-0666

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

Uses ACTIVITY_PAT secret instead of GITHUB_TOKEN. The PAT owner
must be added to the branch protection bypass list for this to work.

Co-authored-by: Walter Galvao <waltergalvao@users.noreply.github.com>
@cursor cursor Bot changed the title fix: use PR-based approach for monthly activity commit fix: use PAT to bypass branch protection for monthly activity Jul 27, 2026
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.

2 participants