Skip to content

build: adopt v0.1.x release branching and backport automation - #23

Open
Roasbeef wants to merge 1 commit into
mainfrom
v0.1-release-setup
Open

build: adopt v0.1.x release branching and backport automation#23
Roasbeef wants to merge 1 commit into
mainfrom
v0.1-release-setup

Conversation

@Roasbeef

@Roasbeef Roasbeef commented Jul 8, 2026

Copy link
Copy Markdown
Member

Prep for the public v0.1 release: adopt lnd's trunk-based release model so
main keeps moving while a stable release line lives on v0.1.x-branch, with
fixes flowing back via labeled backports.

What's here

  • .github/workflows/backport.yml — cherry-picks a merged main PR onto a
    release branch when it carries a backport-v<version>-branch label (draft PR
    on conflict).
  • docs/release_branch_management.md + docs/backport-workflow.md
    the branch model and backport flow, adapted to the Changesets-driven
    versioning this repo already uses (no Go build/version.go).

No version change on main: Changesets continues to drive versions here.

Follow-ups (out of band)

  • The v0.1.x-branch release branch + its 0.1.0 version PR (sets
    packages/{core,web,react} to 0.1.0).
  • Create the backport-v0.1.x-branch label and branch protection.

Part of a coordinated v0.1 setup across darepo-client, darepo, swapdk-server,
dawallet, and damobile.

Adopt lnd's trunk-based release model so main can keep moving while a
stable release line lives on a side branch. Fixes flow from main to the
release branch via labeled backports rather than merge freezes.

  - .github/workflows/backport.yml cherry-picks a merged main PR onto a
    release branch when the PR carries a backport-v<version>-branch label,
    opening a draft PR when the cherry-pick conflicts.

  - docs/release_branch_management.md and docs/backport-workflow.md
    describe the branch model and the backport label flow, adapted to the
    Changesets-driven versioning this repo already uses.
shell: bash
run: |
# Extract all backport labels
labels='${{ toJSON(github.event.pull_request.labels.*.name) }}'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell injection via label names. The ${{ toJSON(...) }} expression is expanded textually into the run: script before bash executes, and it lands inside a single-quoted string. toJSON escapes double quotes and backslashes but not single quotes, so a PR label whose name contains a ' breaks out of the quoting. For example a label named '$(id)' renders this line as labels='["'$(id)'"]', and $(id) runs as an unquoted command substitution.

Because this workflow runs on pull_request_target with contents: write and the repo GITHUB_TOKEN, this is an arbitrary-code-execution / privilege-escalation vector (a triager who can apply labels but cannot push to protected branches or read secrets could exploit it).

Fix with the standard pattern: pass the value through env: and reference it as a quoted shell variable so it is never spliced into the script text:

      - name: Validate target branches exist
        id: validate
        shell: bash
        env:
          LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
        run: |
          # Extract all backport labels
          labels="$LABELS"

See backport.yml.

Comment thread docs/backport-workflow.md
- cherry-picks the commits,
- opens a new PR targeting the release branch.

The label can be added before or after the merge — both trigger the workflow.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Em-dash character (U+2014) used. CLAUDE.md: "Do not use the em-dash character (U+2014) anywhere in the repo: comments, TSDoc, markdown, UI copy, config, all of it." (CLAUDE.md)

This file contains literal em-dashes on lines 24, 37, 38, 39, 52, 54, and 58 (e.g. this line: "before or after the merge — both trigger the workflow."). Replace each with a colon, comma, parentheses, or two sentences as reads naturally. (The other two added files are clean; the arrows here are fine.)

@litbot-9000

Copy link
Copy Markdown
Collaborator

@Roasbeef, remember to re-request review from reviewers when ready

2 similar comments
@litbot-9000

Copy link
Copy Markdown
Collaborator

@Roasbeef, remember to re-request review from reviewers when ready

@litbot-9000

Copy link
Copy Markdown
Collaborator

@Roasbeef, remember to re-request review from reviewers when ready

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