forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (44 loc) · 1.45 KB
/
auto_label.yml
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
name: Label PRs & Issues
on:
issues:
types: [opened, edited]
pull_request_target:
types: [edited, opened, synchronize, reopened]
jobs:
auto-label-rocm:
runs-on: ubuntu-18.04
steps:
- name: Retrieve information
id: vars
run: |
set -eux
if [[ "${{ github.event_name }}" == "pull_request_target" ]]; then
TITLE="${PR_TITLE}"
ISSUE_NUMBER="${PR_NUMBER}"
else
TITLE="${ISSUE_TITLE}"
ISSUE_NUMBER="${ISSUE_NUMBER}"
fi
echo ::set-output name=TITLE::"${TITLE}"
echo ::set-output name=ISSUE_NUMBER::"${ISSUE_NUMBER}"
env:
PR_TITLE: ${{ github.event.pull_request.title }}
PR_NUMBER: ${{ github.event.pull_request.number }}
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_NUMBER: ${{ github.event.issue.number }}
- name: Auto-label ROCm
run: |
set -eux
if [[ "${TITLE,,}" == *rocm* ]]; then
curl \
-X POST \
-H "Authorization: token ${GITHUB_TOKEN}" \
"https://api.github.com/repos/${OWNER}/${REPO}/issues/${ISSUE_NUMBER}/labels" \
-d '{"labels":["module: rocm"]}'
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TITLE: ${{ steps.vars.outputs.TITLE }}
ISSUE_NUMBER: ${{ steps.vars.outputs.ISSUE_NUMBER }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}