1# 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 7# release branch (release/Y.x) and if successful push the result to a branch 8# 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 17on: 18 issue_comment: 19 types: 20 - created 21 - edited 22 23env: 24 COMMENT_BODY: ${{ github.event.comment.body }} 25 26jobs: 27 backport-commits: 28 name: Backport Commits 29 runs-on: ubuntu-20.04 30 if: >- 31 (github.repository == 'llvm/llvm-project') && 32 !startswith(github.event.comment.body, '<!--IGNORE-->') && 33 contains(github.event.comment.body, '/cherry-pick') 34 steps: 35 - name: Fetch LLVM sources 36 uses: actions/checkout@v2 37 with: 38 repository: llvm/llvm-project 39 fetch-depth: 0 40 41 - name: Setup Environment 42 run: | 43 pip install -r ./llvm/utils/git/requirements.txt 44 ./llvm/utils/git/github-automation.py --token ${{ github.token }} setup-llvmbot-git 45 46 - name: Backport Commits 47 run: | 48 printf "$COMMENT_BODY" | 49 ./llvm/utils/git/github-automation.py \ 50 --repo $GITHUB_REPOSITORY \ 51 --token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \ 52 release-workflow \ 53 --issue-number ${{ github.event.issue.number }} \ 54 auto 55 56 create-pull-request: 57 name: Create Pull Request 58 runs-on: ubuntu-20.04 59 if: >- 60 (github.repository == 'llvm/llvm-project') && 61 !startswith(github.event.comment.body, '<!--IGNORE-->') && 62 contains(github.event.comment.body, '/branch') 63 64 steps: 65 - name: Fetch LLVM sources 66 uses: actions/checkout@v2 67 68 - name: Setup Environment 69 run: | 70 pip install -r ./llvm/utils/git/requirements.txt 71 72 - name: Create Pull Request 73 run: | 74 printf "$COMMENT_BODY" | 75 ./llvm/utils/git/github-automation.py \ 76 --repo $GITHUB_REPOSITORY \ 77 --token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \ 78 release-workflow \ 79 --issue-number ${{ github.event.issue.number }} \ 80 auto 81