Skip to content

Commit

Permalink
ci: restore old backport workflow because the overhauled workflow doe…
Browse files Browse the repository at this point in the history
…s not work

It fails with "failed to fork: HTTP 403: Resource not accessible by integration".
  • Loading branch information
radoering committed Apr 27, 2024
1 parent ef75e7c commit 10a3422
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions .github/workflows/backport.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,27 @@ on:

jobs:
backport:
name: Create backport
name: Backport
runs-on: ubuntu-latest
# This workflow only applies to merged PRs; and triggers on a PR being closed, or the backport label being applied.
# 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' && contains(github.event.pull_request.labels.*.name, 'backport/'))
||
(github.event.action == 'labeled' && contains(github.event.label.name, 'backport/')
github.event.action == 'closed'
|| (
github.event.action == 'labeled'
&& contains(github.event.label.name, 'backport/')
)
)
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
# This workflow requires a non-GHA token in order to trigger downstream CI, and to access the 'fork' repository.
- uses: actions/create-github-app-token@78e5f2ddc08efcb88fbbee6cfa3fed770ba550c3 # v1
- uses: actions/create-github-app-token@7bfa3a4717ef143a604ee0a99d859b8886a96d00 # v1.9.3
id: app-token
with:
app-id: ${{ secrets.POETRY_TOKEN_APP_ID }}
private-key: ${{ secrets.POETRY_TOKEN_APP_KEY }}
- name: backport.sh
run: |
git config --global user.name "${{ steps.app-token.outputs.slug }}[bot]"
git config --global user.email "${{ steps.app-token.outputs.slug }}[bot]@users.noreply.github.com"
gh repo fork --remote-name fork
./.github/scripts/backport.sh --pr ${{ github.event.pull_request.number }} --comment --remote fork
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
app_id: ${{ secrets.POETRY_TOKEN_APP_ID }}
private_key: ${{ secrets.POETRY_TOKEN_APP_ID }}
- uses: tibdex/backport@9565281eda0731b1d20c4025c43339fb0a23812e # v2.0.4
with:
github_token: ${{ steps.app-token.outputs.token }}
title_template: "[<%= base %>] <%= title %>"
label_pattern: "^backport/(?<base>([^ ]+))$"

0 comments on commit 10a3422

Please sign in to comment.