|
6 | 6 |
|
7 | 7 | jobs: |
8 | 8 | move_needs_info: |
9 | | - name: Move X-Needs-Info on the triage board |
10 | 9 | runs-on: ubuntu-latest |
11 | 10 | if: > |
12 | 11 | contains(github.event.issue.labels.*.name, 'X-Needs-Info') |
| 12 | + permissions: |
| 13 | + contents: read |
| 14 | + env: |
| 15 | + # This token must have the following scopes: ["repo:public_repo", "admin:org->read:org", "user->read:user", "project"] |
| 16 | + GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} |
| 17 | + PROJECT_OWNER: matrix-org |
| 18 | + # Backend issue triage board. |
| 19 | + # https://github.com/orgs/matrix-org/projects/67/views/1 |
| 20 | + PROJECT_NUMBER: 67 |
| 21 | + ISSUE_URL: ${{ github.event.issue.html_url }} |
| 22 | + # This field is case-sensitive. |
| 23 | + TARGET_STATUS: Needs info |
13 | 24 | steps: |
14 | | - - uses: actions/add-to-project@4515659e2b458b27365e167605ac44f219494b66 # v1.0.2 |
15 | | - id: add_project |
| 25 | + - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
16 | 26 | with: |
17 | | - project-url: "https://github.com/orgs/matrix-org/projects/67" |
18 | | - github-token: ${{ secrets.ELEMENT_BOT_TOKEN }} |
19 | | - # This action will error if the issue already exists on the project. Which is |
20 | | - # common as `X-Needs-Info` will often be added to issues that are already in |
21 | | - # the triage queue. Prevent the whole job from failing in this case. |
22 | | - continue-on-error: true |
23 | | - - name: Set status |
24 | | - env: |
25 | | - GITHUB_TOKEN: ${{ secrets.ELEMENT_BOT_TOKEN }} |
26 | | - run: | |
27 | | - gh api graphql -f query=' |
28 | | - mutation( |
29 | | - $project: ID! |
30 | | - $item: ID! |
31 | | - $fieldid: ID! |
32 | | - $columnid: String! |
33 | | - ) { |
34 | | - updateProjectV2ItemFieldValue( |
35 | | - input: { |
36 | | - projectId: $project |
37 | | - itemId: $item |
38 | | - fieldId: $fieldid |
39 | | - value: { |
40 | | - singleSelectOptionId: $columnid |
41 | | - } |
42 | | - } |
43 | | - ) { |
44 | | - projectV2Item { |
45 | | - id |
46 | | - } |
47 | | - } |
48 | | - }' -f project="PVT_kwDOAIB0Bs4AFDdZ" -f item=${{ steps.add_project.outputs.itemId }} -f fieldid="PVTSSF_lADOAIB0Bs4AFDdZzgC6ZA4" -f columnid=ba22e43c --silent |
| 27 | + # Only clone the script file we care about, instead of the whole repo. |
| 28 | + sparse-checkout: .ci/scripts/triage_labelled_issue.sh |
| 29 | + |
| 30 | + - name: Ensure issue exists on the board, then set Status |
| 31 | + run: .ci/scripts/triage_labelled_issue.sh |
0 commit comments