ci: add reusable label-driven backport workflow#1
Merged
Conversation
Lifted from StabilityMatrix's backport.yml so any org repo can adopt label-driven backports with a 3-line caller. Differences from the SM original: - mainline defaults to 1 unconditionally (the base-branch parent of a GitHub merge commit), replacing the branch-name-conditional 1/2 logic whose else-branch was never exercised; overridable via input - config JSON written with a plain run step instead of the third-party jsdaniell/create-json action - merged+labeled guard lives in the reusable job so callers stay thin - optional 'token' secret for a future PAT/App token upgrade so backport PRs can trigger CI Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Note Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported. |
Adds optional GitHub App authentication for backport PRs. When the org variable BACKPORT_APP_ID and secret BACKPORT_APP_PRIVATE_KEY are present (reached via the caller's `secrets: inherit`), the workflow mints an installation token so backport PRs carry the App's name/avatar and trigger CI — the two things GITHUB_TOKEN can't do. Skips cleanly and falls back to GITHUB_TOKEN when the App isn't set up, so callers work either way. Replaces the earlier ad-hoc `token` secret input, which is superseded by the App path. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
mohnjiles
approved these changes
Jul 4, 2026
mohnjiles
approved these changes
Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Lifts StabilityMatrix's
backport.ymlinto an org-level reusable workflow (same pattern ascsharpier-check.yml) so all repos get label-driven backports from a thin caller:lykos-backportGitHub App (optional, graceful)When the org variable
BACKPORT_APP_IDand org secretBACKPORT_APP_PRIVATE_KEYare set (reached via the caller'ssecrets: inherit), the workflow mints an installation token withactions/create-github-app-token@v3. Backport PRs are then authored by the lykos-backport App — its name + avatar — and, crucially, trigger CI (PRs opened with the defaultGITHUB_TOKENdon't). Theif: vars.BACKPORT_APP_ID != ''gate means it skips cleanly and falls back toGITHUB_TOKENwhen the App isn't configured, so this can merge before the App exists.Differences from the SM original
mainlinedefaults to 1 unconditionally. SM computed1for merges todev, else2— from a trial-and-error fix ("Fix mainline maybe", June 2024). For a standard GitHub merge commit, parent 1 is always the base-branch side, so-m 1replays exactly the PR's changes for any base branch. Theelse 2path was never exercised (all SM backports were dev→main). Still overridable via input.create-jsonaction — config written with a plainrunstep.commitConflictsis a real boolean instead of the string"true".Inputs (
target_pr_labels,auto_backport_label_prefix,mainline,pr_title) default to SM's current values.Callers (merge after this — they reference
@main): StabilityMatrix#1674, Lykos.Chat.Api#33, Lykos.Chat.Web#20.🤖 Generated with Claude Code