Skip to content

Bump 0.17.3 rc.0

Bump 0.17.3 rc.0 #950

Workflow file for this run

name: Backport merged pull request
on:
pull_request_target:
# Run on merge (close) or if label is added after merging
types: [closed, labeled]
# Set concurrency limit to a single backport workflow per PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
backport:
permissions:
contents: write # so it can comment
pull-requests: write # so it can create pull requests
name: Backport pull request
runs-on: ubuntu-latest
# Don't run on closed unmerged pull requests or if a non-backport label is added
if: |
github.event.pull_request.merged &&
(
github.event.action != 'labeled' ||
contains(github.event.label.name, 'backport')
)
outputs:
was_successful: ${{ steps.create-pr.outputs.was_successful }}
steps:
- uses: actions/checkout@v5
- id: create-pr
name: Create backport pull requests
uses: korthout/backport-action@v4.5.2
with:
github_token: ${{ secrets.BACKPORT_TOKEN }}
open-issue:
permissions:
contents: read
issues: write
name: Open issue for failed backports
runs-on: ubuntu-latest
needs: backport
# Open an issue only if the backport job failed
if: ${{ needs.backport.outputs.was_successful == 'false' }}
steps:
- uses: actions/checkout@v5
- name: Set SHORT_PR_TITLE env
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
SHORT_PR_TITLE=$(
echo "$PR_TITLE" \
| awk '{print (length($0) > 40) ? substr($0, 1, 40) "..." : $0}'
)
echo "SHORT_PR_TITLE=$SHORT_PR_TITLE" >> "$GITHUB_ENV"
- name: Create issue
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
SHORT_PR_TITLE: ${{ env.SHORT_PR_TITLE }}
run: |
cat > issue-body.md <<EOF
PR: #${PR_NUMBER}
Title: ${PR_TITLE}
The backport bot failed. Please open a PR to backport these changes.
EOF
gh issue create \
--repo "${GITHUB_REPOSITORY}" \
--title "Backport PR #${PR_NUMBER} ${SHORT_PR_TITLE}" \
--label backport \
--body-file issue-body.md