|
1 | | -name: Add maintenance PRs to the docs-content FR project v2 |
2 | 1 |
|
3 | | -# **What it does**: Adds docs-internal pull requests authored by docs-bot to the docs-content FR project v2 |
4 | | -# **Why we have it**: So we don't lose track of maintenance pull requests for docs-content to review |
5 | | -# **Who does it impact**: Docs content |
6 | | - |
7 | | -on: |
8 | | - pull_request: |
9 | | - types: |
10 | | - - reopened |
11 | | - - opened |
12 | | - - ready_for_review |
13 | | - |
14 | | -permissions: |
15 | | - contents: read |
16 | | - pull-requests: write |
17 | | - repository-projects: write |
18 | | - |
19 | | -jobs: |
20 | | - first-responder-triage-pr: |
21 | | - name: Add maintenance PR to FR project v2 |
22 | | - if: github.repository == 'github/docs-internal' && github.event.pull_request.draft == false && github.event.pull_request.user.id == 77750099 && github.event.pull_request.head.ref != 'repo-sync' && !contains(github.event.pull_request.labels.*.name, 'skip FR board') |
23 | | - runs-on: ubuntu-latest |
24 | | - |
25 | | - steps: |
26 | | - - name: Checkout repository |
27 | | - |
28 | | - |
29 | | - # Add to the FR project |
30 | | - # and set type to "Maintenance" |
31 | | - # and set date to now |
32 | | - - name: Triage to docs-content FR project |
33 | | - env: |
34 | | - GITHUB_TOKEN: ${{ secrets.DOCS_BOT_PAT_BASE }} |
35 | | - PR_URL: ${{ github.event.pull_request.html_url }} |
36 | | - PROJECT_NUMBER: 11672 |
37 | | - PROJECT_ID: PVT_kwDNJr_OAGNkBg |
38 | | - TYPE_FIELD_ID: PVTSSF_lADNJr_OAGNkBs4D-Nyn |
39 | | - DATE_FIELD_ID: PVTF_lADNJr_OAGNkBs4D-N1h |
40 | | - TYPE_FIELD_VALUE: 3f142cf2 |
41 | | - run: | |
42 | | - echo "Adding item to project..." |
43 | | -
|
44 | | - ITEM_ID=$(gh project item-add $PROJECT_NUMBER --owner github --url $PR_URL --format json | jq .id) |
45 | | -
|
46 | | - echo "Editing type..." |
47 | | -
|
48 | | - gh project item-edit --project-id $PROJECT_ID --id $ITEM_ID --field-id $TYPE_FIELD_ID --single-select-option-id $TYPE_FIELD_VALUE |
49 | | -
|
50 | | - echo "Editing date..." |
51 | | -
|
52 | | - DATE=$(date '+%Y-%m-%d') |
53 | | -
|
54 | | - gh project item-edit --project-id $PROJECT_ID --id $ITEM_ID --field-id $DATE_FIELD_ID --date $DATE |
55 | | -
|
56 | | - echo "done editing" |
0 commit comments