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
37 (github.repository == 'llvm/llvm-project') &&
38 !startswith(github.event.comment.body, '<!--IGNORE-->') &&
39 contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
41 - name: Fetch LLVM sources
42 uses: actions/checkout@v3
44 repository: llvm/llvm-project
45 # GitHub stores the token used for checkout and uses it for pushes
46 # too, but we want to use a different token for pushing, so we need
47 # to disable persist-credentials here.
48 persist-credentials: false
51 - name: Setup Environment
53 pip install -r ./llvm/utils/git/requirements.txt
54 ./llvm/utils/git/github-automation.py --token ${{ github.token }} setup-llvmbot-git
56 - name: Backport Commits
58 printf "$COMMENT_BODY" |
59 ./llvm/utils/git/github-automation.py \
60 --repo $GITHUB_REPOSITORY \
61 --token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
63 --issue-number ${{ github.event.issue.number }} \
64 --phab-token ${{ secrets.RELEASE_WORKFLOW_PHAB_TOKEN }} \
68 name: Create Pull Request
69 runs-on: ubuntu-latest
71 (github.repository == 'llvm/llvm-project') &&
72 !startswith(github.event.comment.body, '<!--IGNORE-->') &&
73 contains(github.event.comment.body, '/branch')
76 - name: Fetch LLVM sources
77 uses: actions/checkout@v3
79 persist-credentials: false
81 - name: Setup Environment
83 pip install -r ./llvm/utils/git/requirements.txt
85 - name: Create Pull Request
87 printf "$COMMENT_BODY" |
88 ./llvm/utils/git/github-automation.py \
89 --repo $GITHUB_REPOSITORY \
90 --token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
92 --issue-number ${{ github.event.issue.number }} \
93 --phab-token ${{ secrets.RELEASE_WORKFLOW_PHAB_TOKEN }} \