-
Notifications
You must be signed in to change notification settings - Fork 793
46 lines (44 loc) · 1.62 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
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_NUMBER: 39
PROJECT_ID: PVT_kwDOAYA3Ss1Nvw
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:
- name: Get issue ID
id: get_issue_id
run: |
ISSUE_ID=$(gh project item-list $PROJECT_NUMBER --owner=$OWNER --limit=$ITEM_FETCH_LIMIT --format=json --jq ".items[] | select(.content.number == $ISSUE_NUMBER and .content.repository == $REPOSITORY) | .id")
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"
env:
GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
- 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: ${{ secrets.ADD_TO_PROJECT_PAT }}
$ISSUE_ID: ${{ steps.get_issue_id.outputs.issue_id }}