-
Notifications
You must be signed in to change notification settings - Fork 1.3k
42 lines (38 loc) · 1.63 KB
/
pr-triage.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
name: pr triage
on:
pull_request_target:
types: [opened, labeled]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COLUMN_NAME: Hero to triage # column where issues will be created
jobs:
content_project:
name: pr added to the docs github board (optional)
runs-on: ubuntu-latest
env:
PROJECT_ID: 11873277
PROJECT_NAME: Docs PRs and Issues
steps:
- name: Triages NEW pull requests to the Content Project
if: github.event.action == 'opened'
run: |
HEADER="Accept: application/vnd.github.inertia-preview+json"
PR_ID=${{ github.event.pull_request.id }}
COLUMN=$(gh api -H "$HEADER" projects/$PROJECT_ID/columns --jq ".[] | select(.name == \"$COLUMN_NAME\").id")
gh api -H "$HEADER" -X POST projects/columns/$COLUMN/cards -f content_type='PullRequest' -F content_id=$PR_ID
localization_project:
name: pr added to the localization github board (optional)
runs-on: ubuntu-latest
env:
PROJECT_ID: 12004783
PROJECT_NAME: Docs Site Localization PRs and Issues
steps:
- name: Triages NEW pull requests to the Localization Project
if: |
github.event.action == 'labeled' &&
contains(github.event.pull_request.labels.*.name, 'translations')
run: |
HEADER="Accept: application/vnd.github.inertia-preview+json"
PR_ID=${{ github.event.pull_request.id }}
COLUMN=$(gh api -H "$HEADER" projects/$PROJECT_ID/columns --jq ".[] | select(.name == \"$COLUMN_NAME\").id")
gh api -H "$HEADER" -X POST projects/columns/$COLUMN/cards -f content_type='PullRequest' -F content_id=$PR_ID