-
Notifications
You must be signed in to change notification settings - Fork 785
48 lines (46 loc) · 1.7 KB
/
issue-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
43
44
45
46
47
48
name: Issue Triage
on:
issues:
types: [opened]
issue_comment:
types: [created]
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
OWNER: ${{ github.repository_owner }}
REPOSITORY: ${{ github.repository }}
PROJECT_ID: 39
ITEM_FETCH_LIMIT: 1200
AREA_FIELD_ID: PVTSSF_lADOAYA3Ss1Nv84BfRL4
AREA_WEBSITE: 113a0859
jobs:
issue-triage:
uses: carbon-design-system/carbon/.github/workflows/issue-triage.yml@main
secrets:
APP_ID: ${{ secrets.APP_ID }}
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
set-area-per-repo:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
steps:
- uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ secrets.APP_ID }}
private-key: ${{ secrets.APP_PRIVATE_KEY }}
- name: Get issue ID
id: get_issue_id
run: |
ISSUE_ID=$(gh project item-list $PROJECT_ID --owner=$OWNER --limit=$ITEM_FETCH_LIMIT --format=json --jq ".items[] | select(.content.number == $ISSUE_NUMBER and .content.repository == $REPOSITORY) | .id" -r)
if [ -z "$ISSUE_ID" ]; then
echo "Issue ID not found for issue number $ISSUE_NUMBER"
exit 1
fi
echo "Issue ID is $ISSUE_ID"
echo "issue_id=$ISSUE_ID" >> "$GITHUB_OUTPUT"
- name: Update issue with website area field
run:
gh project item-edit --project-id $PROJECT_ID --id $ISSUE_ID
--field-id $AREA_FIELD_ID --single-select-option-id $AREA_WEBSITE
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
$ISSUE_ID: ${{ steps.get_issue_id.outputs.issue_id }}