blob: efd045990d0130491449bae0c32a075833041bc6 [file] [log] [blame]
Tom Stellarddaf82a52022-02-03 22:44:071# This contains the workflow definitions that allow users to test backports
2# to the release branch using comments on issues.
3#
4# /cherry-pick <commit> <...>
5#
6# This comment will attempt to cherry-pick the given commits to the latest
Mohammed Keyvanzadeh7e5f75a2022-05-09 01:02:267# release branch (release/Y.x) and if successful, push the result to a branch
Tom Stellarddaf82a52022-02-03 22:44:078# on github.
9#
10# /branch <owner>/<repo>/<branch>
11#
12# This comment will create a pull request from <branch> to the latest release
13# branch.
14
15name: Issue Release Workflow
16
Joyce Brum829b8912023-03-04 05:34:2517permissions:
18 contents: read
19
Tom Stellarddaf82a52022-02-03 22:44:0720on:
21 issue_comment:
22 types:
23 - created
24 - edited
Tom Stellardfee491a2022-02-17 06:18:0325 issues:
26 types:
27 - opened
Tom Stellarddaf82a52022-02-03 22:44:0728
29env:
Tom Stellardfee491a2022-02-17 06:18:0330 COMMENT_BODY: ${{ github.event.action == 'opened' && github.event.issue.body || github.event.comment.body }}
Tom Stellarddaf82a52022-02-03 22:44:0731
32jobs:
33 backport-commits:
34 name: Backport Commits
Aiden Grossman0ce4b682025-03-06 18:32:0235 runs-on: ubuntu-24.04
Nikita Popov5db2e582024-01-24 14:42:4836 permissions:
37 issues: write
Tom Stellarde99edf62024-01-25 21:11:0938 pull-requests: write
Tom Stellarddaf82a52022-02-03 22:44:0739 if: >-
Mohammed Keyvanzadeh7e5f75a2022-05-09 01:02:2640 (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')
Tom Stellarddaf82a52022-02-03 22:44:0743 steps:
44 - name: Fetch LLVM sources
Aiden Grossman705decc2025-03-03 16:37:2045 uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Tom Stellarddaf82a52022-02-03 22:44:0746 with:
47 repository: llvm/llvm-project
Tom Stellard9bbe44f2022-02-05 06:22:0148 # 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
Tom Stellarddaf82a52022-02-03 22:44:0752 fetch-depth: 0
53
54 - name: Setup Environment
55 run: |
Tom Stellard89b83d22024-05-17 13:49:2756 pip install --require-hashes -r ./llvm/utils/git/requirements.txt
Tom Stellarddaf82a52022-02-03 22:44:0757 ./llvm/utils/git/github-automation.py --token ${{ github.token }} setup-llvmbot-git
58
59 - name: Backport Commits
60 run: |
Mohammed Keyvanzadeh859e6aa2023-09-12 22:21:4761 printf "%s" "$COMMENT_BODY" |
Tom Stellarddaf82a52022-02-03 22:44:0762 ./llvm/utils/git/github-automation.py \
Mohammed Keyvanzadeh859e6aa2023-09-12 22:21:4763 --repo "$GITHUB_REPOSITORY" \
Tom Stellardd2c81672024-01-26 19:25:5364 --token "${{ secrets.RELEASE_WORKFLOW_PR_CREATE }}" \
Tom Stellarddaf82a52022-02-03 22:44:0765 release-workflow \
Nikita Popovf03a60d2024-01-24 15:05:5666 --branch-repo-token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
Tom Stellarddaf82a52022-02-03 22:44:0767 --issue-number ${{ github.event.issue.number }} \
Tom Stellard0be1c3b2024-03-09 22:20:1568 --requested-by ${{ (github.event.action == 'opened' && github.event.issue.user.login) || github.event.comment.user.login }} \
Tom Stellarddaf82a52022-02-03 22:44:0769 auto