1 # This contains the workflow definitions that allow users to test backports
2 # to the release branch using comments on issues.
4 # /cherry-pick <commit> <...>
6 # This comment will attempt to cherry-pick the given commits to the latest
7 # release branch (release/Y.x) and if successful, push the result to a branch
10 # /branch <owner>/<repo>/<branch>
12 # This comment will create a pull request from <branch> to the latest release
15 name: Issue Release Workflow
30 COMMENT_BODY: ${{ github.event.action == 'opened' && github.event.issue.body || github.event.comment.body }}
34 name: Backport Commits
35 runs-on: ubuntu-latest
40 (github.repository == 'llvm/llvm-project') &&
41 !startswith(github.event.comment.body, '<!--IGNORE-->') &&
42 contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
44 - name: Fetch LLVM sources
45 uses: actions/checkout@v4
47 repository: llvm/llvm-project
48 # GitHub stores the token used for checkout and uses it for pushes
49 # too, but we want to use a different token for pushing, so we need
50 # to disable persist-credentials here.
51 persist-credentials: false
54 - name: Setup Environment
56 pip install --require-hashes -r ./llvm/utils/git/requirements.txt
57 ./llvm/utils/git/github-automation.py --token ${{ github.token }} setup-llvmbot-git
59 - name: Backport Commits
61 printf "%s" "$COMMENT_BODY" |
62 ./llvm/utils/git/github-automation.py \
63 --repo "$GITHUB_REPOSITORY" \
64 --token "${{ secrets.RELEASE_WORKFLOW_PR_CREATE }}" \
66 --branch-repo-token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
67 --issue-number ${{ github.event.issue.number }} \
68 --requested-by ${{ (github.event.action == 'opened' && github.event.issue.user.login) || github.event.comment.user.login }} \