diff --git a/.backportrc.json b/.backportrc.json deleted file mode 100644 index 53b5e3e..0000000 --- a/.backportrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "repoOwner": "agritheory", - "repoName": "check_run", - "targetBranchChoices": [ - "version-14", - "version-15" - ], - "branchLabelMapping": { - "^backport-to-(.+)$": "$1" - } -} \ No newline at end of file diff --git a/.github/workflows/backport.yml b/.github/workflows/backport.yml index 2fef06c..971e8a6 100644 --- a/.github/workflows/backport.yml +++ b/.github/workflows/backport.yml @@ -1,24 +1,26 @@ -name: Automatic backport action - +name: Backport on: pull_request_target: - types: ["labeled", "closed"] + types: + - closed + - labeled jobs: backport: - name: Backport PR + name: Backport runs-on: ubuntu-latest + # Only react to merged PRs for security reasons. + # See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target. + if: > + github.event.pull_request.merged + && ( + github.event.action == 'closed' + || ( + github.event.action == 'labeled' + && contains(github.event.label.name, 'backport') + ) + ) steps: - - name: Backport Action - uses: sorenlouv/backport-github-action@v9.5.1 + - uses: tibdex/backport@v2 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - auto_backport_label_prefix: backport-to- - - - name: Info log - if: ${{ success() }} - run: cat ~/.backport/backport.info.log - - - name: Debug log - if: ${{ failure() }} - run: cat ~/.backport/backport.debug.log \ No newline at end of file + github_token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file