name: Prowler - Automatic Backport on: pull_request_target: branches: ['master'] types: ['labeled', 'closed'] env: # The prefix of the label that triggers the backport must not contain the branch name # so, for example, if the branch is 'master', the label should be 'backport-to-' BACKPORT_LABEL_PREFIX: backport-to- BACKPORT_LABEL_IGNORE: was-backported jobs: backport: name: Backport PR if: github.event.pull_request.merged == true && !(contains(github.event.pull_request.labels.*.name, 'backport')) && !(contains(github.event.pull_request.labels.*.name, 'was-backported')) runs-on: ubuntu-latest permissions: id-token: write pull-requests: write contents: write steps: - name: Check labels id: preview_label_check uses: docker://agilepathway/pull-request-label-checker:v1.6.55 with: allow_failure: true prefix_mode: true any_of: ${{ env.BACKPORT_LABEL_PREFIX }} none_of: ${{ env.BACKPORT_LABEL_IGNORE }} repo_token: ${{ secrets.GITHUB_TOKEN }} - name: Backport Action if: steps.preview_label_check.outputs.label_check == 'success' uses: sorenlouv/backport-github-action@v9.5.1 with: github_token: ${{ secrets.PROWLER_BOT_ACCESS_TOKEN }} auto_backport_label_prefix: ${{ env.BACKPORT_LABEL_PREFIX }} - name: Info log if: ${{ success() && steps.preview_label_check.outputs.label_check == 'success' }} run: cat ~/.backport/backport.info.log - name: Debug log if: ${{ failure() && steps.preview_label_check.outputs.label_check == 'success' }} run: cat ~/.backport/backport.debug.log