sorenlouv / backport-github-action

Backport CLI tool as a Github Action
https://github.com/sqren/backport
24 stars 16 forks source link

Provide a way to backport a PR to one or more branches #99

Closed laeubi closed 10 months ago

laeubi commented 1 year ago

In a project we have two active branches:

I simply want that EVERY PR merged to master is automatically tried to be backported to the previous release.

It would therefore be great if one can simply specify the branch for the backport as an option instead of using a label at all.

sorenlouv commented 10 months ago

Hi there,

Apologies for the late reply. You can already achieve this. Please create a file in your repo called .backportrc.json:

{
  "upstream": "{orgName}/{repoName}",
  "targetBranches": ["release-<previsous-version>"],
}

Please also update .github/workflows/backport.yml:

on:    
  pull_request_target:
    types: ["closed"]
    branches: ["master"]
jobs:
  backport:
    name: Backport PR
    runs-on: ubuntu-latest
    steps:
      - name: Backport Action
        uses: sqren/backport-github-action@main
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}    

I'll close this issue. Don't hesitate to reach out if you have any questions!