-
Notifications
You must be signed in to change notification settings - Fork 31
74 lines (66 loc) · 2.49 KB
/
Copy pathissue-release-workflow.yml
File metadata and controls
74 lines (66 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# This contains the workflow definitions that allow users to test backports
# to the release branch using comments on issues.
#
# /cherry-pick <commit> <...>
#
# This comment will attempt to cherry-pick the given commits to the latest
# release branch (release/qualcomm-software/Y.x) and if successful, push the result to a branch
# on github.
#
# /branch <owner>/<repo>/<branch>
#
# This comment will create a pull request from <branch> to the latest release
# branch.
name: Issue Release Workflow
permissions:
contents: read
on:
issue_comment:
types:
- created
- edited
issues:
types:
- opened
env:
COMMENT_BODY: ${{ github.event.action == 'opened' && github.event.issue.body || github.event.comment.body }}
jobs:
backport-commits:
name: Backport Commits
runs-on: ubuntu-24.04
environment: main-branch-only
permissions:
issues: write
pull-requests: write
if: >-
(github.repository == 'qualcomm/cpullvm-toolchain') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
contains(github.event.action == 'opened' && github.event.issue.body || github.event.comment.body, '/cherry-pick')
steps:
- name: Fetch cpullvm sources
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
repository: qualcomm/cpullvm-toolchain
# GitHub stores the token used for checkout and uses it for pushes
# too, but we want to use a different token for pushing, so we need
# to disable persist-credentials here.
persist-credentials: false
fetch-depth: 0
- name: Setup Environment
run: |
pip install --require-hashes -r ./llvm/utils/git/requirements.txt
# Set committer identity for commits created by this workflow
git config user.name "cpullvmbot"
git config user.email "cpullvmbot@qti.qualcomm.com"
- name: Backport Commits
run: |
printf "%s" "$COMMENT_BODY" |
./llvm/utils/git/github-automation.py \
--repo "$GITHUB_REPOSITORY" \
--token "${{ secrets.RELEASE_WORKFLOW_PR_CREATE }}" \
release-workflow \
--branch-repo-token ${{ secrets.RELEASE_WORKFLOW_PUSH_SECRET }} \
--branch-repo "$GITHUB_REPOSITORY" \
--issue-number ${{ github.event.issue.number }} \
--requested-by ${{ (github.event.action == 'opened' && github.event.issue.user.login) || github.event.comment.user.login }} \
auto