fix: use PARENT_REPO_PAT for sync commits to protected main - #42
Conversation
REPO_WRITE_PACKAGES_PAT doesn't have permission to bypass branch protection rules. Switch to PARENT_REPO_PAT (org-level secret) which is the same PAT used by gitkb-core for cross-repo operations. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughGitHub Actions workflow updated to swap the authentication secret used during repository checkout, replacing Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Greptile SummaryThis PR makes a targeted, single-line fix to Key changes:
Notes:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| .github/workflows/on-child-update.yml | Single-line change swapping REPO_WRITE_PACKAGES_PAT for PARENT_REPO_PAT in the checkout step so the subsequent git push to protected main is authorized. |
Sequence Diagram
sequenceDiagram
participant ChildRepo as Child Repo Workflow
participant GH as GitHub API
participant Workflow as on-child-update.yml
participant Main as Protected main branch
ChildRepo->>GH: repository_dispatch (child-repo-updated)
GH->>Workflow: Trigger job: create-sync-commit
Workflow->>GH: actions/checkout@v4 with org-level token
GH-->>Workflow: Repo checked out with elevated credentials
Workflow->>Workflow: Extract payload (repo_name, short_sha, message, type, actor)
Workflow->>Workflow: git config user name and email
Workflow->>Workflow: git commit --allow-empty with sync message
Workflow->>Main: git push using org-level token
Note over Workflow,Main: Branch protection bypassed with correct token
Main-->>Workflow: Push accepted
Workflow->>Workflow: Log sync details
Last reviewed commit: 370eb3f
Summary
on-child-update.ymlfromREPO_WRITE_PACKAGES_PATto org-levelPARENT_REPO_PATContext
Failed run: https://github.com/harmony-labs/meta/actions/runs/22697487943/job/65807070288
REPO_WRITE_PACKAGES_PATcan't bypass branch protection.PARENT_REPO_PATis the org-level PAT already used by gitkb-core for the same purpose.Test plan
🤖 Generated with Claude Code
Summary by CodeRabbit