Skip to content

ci: agentic workflow to keep PRs rebased (gh-aw)#357

Draft
igorpecovnik wants to merge 1 commit into
mainfrom
add-keep-prs-rebased-agentic-workflow
Draft

ci: agentic workflow to keep PRs rebased (gh-aw)#357
igorpecovnik wants to merge 1 commit into
mainfrom
add-keep-prs-rebased-agentic-workflow

Conversation

@igorpecovnik

Copy link
Copy Markdown
Member

Adds a GitHub Agentic Workflow (githubnext/gh-aw) that keeps open PRs rebased on the default branch — per the GitHub Agentic Workflows model. Source is keep-prs-rebased.md; the compiled keep-prs-rebased.lock.yml is committed alongside (gh-aw convention, gh aw compile).

What it does

  • Triggers: daily (04:00 UTC) + manual workflow_dispatch.
  • For each open, non-draft, same-repo PR labelled keep-rebased that's behind the default branch: rebase onto the default branch and push the result back via the push-to-pull-request-branch safe output.
  • On unresolvable conflicts: abort, don't push, and leave a comment (add-comment safe output) asking for a manual rebase.
  • Engine: claude (uses ANTHROPIC_API_KEY, already used by reporting-release-summary.yml).

Safety model (why this is low-risk)

  • Opt-in per PR: nothing happens unless a PR carries the keep-rebased label — the label is enforced both in the prompt and by the push-to-pull-request-branch safe output. No PRs have it yet, so merging this is inert until you label one.
  • No fork writes: the safe output rejects fork PRs by design.
  • Read-only agent: permissions: contents: read, pull-requests: read; the agent never writes to GitHub directly — all writes go through the sanitized safe-outputs job.
  • Scheduled runs only fire on the default branch, so this does nothing until merged.

Security review (required by gh-aw safe-update)

  • Secrets: ANTHROPIC_API_KEY — already present and used by this repo; no new external secret. gh-aw's GH_AW_* tokens fall back to GITHUB_TOKEN.
  • Actions: all pinned by commit SHA — actions/checkout, actions/cache, actions/download-artifact, actions/upload-artifact, actions/github-script, actions/setup-node, github/gh-aw-actions/setup.
  • Containers: GitHub's official gh-aw runtime (firewall/mcp/node), pinned by digest.
  • Network: network: defaults (gh-aw egress allowlist/firewall).
  • I reviewed each of the above; nothing exfiltrates credentials or reaches unexpected hosts.

Notes / knobs

  • To make it non-opt-in (rebase all open PRs), drop required-labels: [keep-rebased].
  • Compiler warns the fixed 04:00 cron could be a fuzzy daily to spread load — left as-is for predictability.
  • Alternative if you'd rather merge base in than rebase (GitHub-native, never force-pushes): switch to the update-pull-request: { update-branch: true } safe output. Say the word and I'll swap it.

Opened as draft for review since it force-pushes to PR branches.

GitHub Agentic Workflow (githubnext/gh-aw): daily + manual, rebases open
same-repo PRs labelled `keep-rebased` onto the default branch and pushes the
result back via the push-to-pull-request-branch safe output; PRs with
unresolvable conflicts get a comment instead. engine: claude (ANTHROPIC_API_KEY,
already used by this repo). Both the .md source and the compiled .lock.yml are
committed per gh-aw convention.

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@github-actions github-actions Bot added 08 Milestone: Third quarter release size/large PR with 250 lines or more GitHub Actions GitHub Actions code Needs review Seeking for review Documentation Documentation changes or additions labels Jul 18, 2026
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

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: e92c3da1-c650-403a-bd56-27bc53eeabee

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 add-keep-prs-rebased-agentic-workflow

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

08 Milestone: Third quarter release Documentation Documentation changes or additions GitHub Actions GitHub Actions code Needs review Seeking for review size/large PR with 250 lines or more

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant