Skip to content

Commit f943c2a

Browse files
SiaraMistheiskr
andauthored
Automation request: Mark docs-bot PRs as "Maintenance" on the FR v2 board (#50721)
Co-authored-by: Kevin Heis <[email protected]>
1 parent 37dd251 commit f943c2a

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

.github/workflows/first-responder-v2-prs-collect.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ jobs:
4444
console.log(`This pull request was authored by an external contributor.`)
4545
return 'false'
4646
47+
# Check if docs-bot authored the PR
48+
# If yes, set Type field to "Maintenance"
49+
# If no, set Type field to "External contributor PR"
50+
- name: Check if docs-bot is PR author
51+
env:
52+
PR_AUTHOR_ID: ${{ github.event.pull_request.user.id }}
53+
run: |
54+
if [ $PR_AUTHOR_ID == 77750099 ]; then
55+
echo "TYPE_FIELD_VALUE=3f142cf2" >> $GITHUB_ENV
56+
else
57+
echo "TYPE_FIELD_VALUE=bbd0922a" >> $GITHUB_ENV
58+
fi
59+
4760
- name: Add the docs-content-fr label
4861
if: ${{ steps.check-membership.outputs.result == 'false' }}
4962
env:
@@ -53,7 +66,7 @@ jobs:
5366
gh pr edit $PR_URL --add-label docs-content-fr
5467
5568
# Add to the FR project
56-
# and set type to "External contributor PR"
69+
# and set type to "Maintenance" or "External contributor PR"
5770
# and set date to now
5871
- name: Triage to docs-content FR project
5972
if: steps.check-membership.outputs.result == 'false'
@@ -64,15 +77,14 @@ jobs:
6477
PROJECT_ID: PVT_kwDNJr_OAGNkBg
6578
TYPE_FIELD_ID: PVTSSF_lADNJr_OAGNkBs4D-Nyn
6679
DATE_FIELD_ID: PVTF_lADNJr_OAGNkBs4D-N1h
67-
EXTERNAL_PR_TYPE_ID: bbd0922a
6880
run: |
6981
echo "Adding item to project..."
7082
7183
ITEM_ID=$(gh project item-add $PROJECT_NUMBER --owner github --url $PR_URL --format json | jq .id)
7284
7385
echo "Editing type..."
7486
75-
gh project item-edit --project-id $PROJECT_ID --id $ITEM_ID --field-id $TYPE_FIELD_ID --single-select-option-id $EXTERNAL_PR_TYPE_ID
87+
gh project item-edit --project-id $PROJECT_ID --id $ITEM_ID --field-id $TYPE_FIELD_ID --single-select-option-id ${{ env.TYPE_FIELD_VALUE }}
7688
7789
echo "Editing date..."
7890

0 commit comments

Comments
 (0)