44
44
console.log(`This pull request was authored by an external contributor.`)
45
45
return 'false'
46
46
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
+
47
60
- name : Add the docs-content-fr label
48
61
if : ${{ steps.check-membership.outputs.result == 'false' }}
49
62
env :
53
66
gh pr edit $PR_URL --add-label docs-content-fr
54
67
55
68
# Add to the FR project
56
- # and set type to "External contributor PR"
69
+ # and set type to "Maintenance" or " External contributor PR"
57
70
# and set date to now
58
71
- name : Triage to docs-content FR project
59
72
if : steps.check-membership.outputs.result == 'false'
@@ -64,15 +77,14 @@ jobs:
64
77
PROJECT_ID : PVT_kwDNJr_OAGNkBg
65
78
TYPE_FIELD_ID : PVTSSF_lADNJr_OAGNkBs4D-Nyn
66
79
DATE_FIELD_ID : PVTF_lADNJr_OAGNkBs4D-N1h
67
- EXTERNAL_PR_TYPE_ID : bbd0922a
68
80
run : |
69
81
echo "Adding item to project..."
70
82
71
83
ITEM_ID=$(gh project item-add $PROJECT_NUMBER --owner github --url $PR_URL --format json | jq .id)
72
84
73
85
echo "Editing type..."
74
86
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 }}
76
88
77
89
echo "Editing date..."
78
90
0 commit comments