From 898e6609f6fbc73584e6dc8f26ee25b66f07dc1e Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:18:17 +0200 Subject: [PATCH 01/10] let's triage this one --- .github/workflows/assign.yml | 10 ++-------- .github/workflows/priority.yml | 7 +------ .github/workflows/status.yml | 6 +++--- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml index 43c9169b96..0e59e916fe 100644 --- a/.github/workflows/assign.yml +++ b/.github/workflows/assign.yml @@ -10,11 +10,5 @@ jobs: steps: - name: Auto-assign PR to author env: - GH_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }} - run: | - pr_number=${{ github.event.pull_request.number }} - pr_author=${{ github.event.pull_request.user.login }} - gh api -X POST \ - -H "Accept: application/vnd.github+json" \ - "/repos/${{ github.repository }}/issues/${pr_number}/assignees" \ - -f assignees='["'${pr_author}'"]' + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.event.pull_request.user.login }} \ No newline at end of file diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index 2a7d75b2a4..5cbe68777e 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -4,7 +4,7 @@ on: issues: types: [opened] pull_request: - types: [opened] + types: [opened, reopened] jobs: set_statuses: @@ -13,12 +13,7 @@ jobs: permissions: pull-requests: write issues: write - env: - GITHUB_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }} steps: - - name: Set up GitHub CLI - run: | - echo "${{ secrets.GITHUB_TOKEN }}" | gh auth login --with-token - name: Get project data env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index ea642a7958..c27e1d1d54 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Get project data env: - GH_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ORGANIZATION: tauri-apps PROJECT_NUMBER: 27 run: | @@ -49,7 +49,7 @@ jobs: - name: Add/get item id env: - GH_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ "${{ github.event.pull_request.node_id }}" != "" ]; then echo "NODE_ID=${{ github.event.pull_request.node_id }}" >> $GITHUB_ENV @@ -102,7 +102,7 @@ jobs: - name: Set fields env: - GH_TOKEN: ${{ secrets.ORG_TAURI_BOT_PAT }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | gh api graphql -f query=' mutation ( From 6dfd35e9eb972beef2a29592f6c4d1202244359f Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:21:46 +0200 Subject: [PATCH 02/10] assign --- .github/workflows/assign.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml index 0e59e916fe..3ceec42cd1 100644 --- a/.github/workflows/assign.yml +++ b/.github/workflows/assign.yml @@ -2,7 +2,7 @@ name: 'Auto Assign' on: pull_request: - types: [opened] + types: [opened, reopened] jobs: auto_assign: @@ -11,4 +11,4 @@ jobs: - name: Auto-assign PR to author env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.event.pull_request.user.login }} \ No newline at end of file + run: gh pr edit ${{ github.event.pull_request.number }} --add-assignee ${{ github.event.pull_request.user.login }} -R ${{ github.repository }} \ No newline at end of file From 95f96762002d65d2af9b92e65cc2a0edd0bb390b Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:26:17 +0200 Subject: [PATCH 03/10] prio --- .github/workflows/priority.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index 5cbe68777e..fb147a9748 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -4,7 +4,7 @@ on: issues: types: [opened] pull_request: - types: [opened, reopened] + #types: [opened] jobs: set_statuses: @@ -20,6 +20,7 @@ jobs: ORGANIZATION: tauri-apps PROJECT_NUMBER: 27 run: | + gh project view 27 gh api graphql -f query=' query($org: String!, $number: Int!) { organization(login: $org){ From 1f1a9ac0d6caebd8b2c2273d785997aba2506879 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:27:42 +0200 Subject: [PATCH 04/10] prio --- .github/workflows/priority.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index fb147a9748..f5cced9256 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -20,7 +20,7 @@ jobs: ORGANIZATION: tauri-apps PROJECT_NUMBER: 27 run: | - gh project view 27 + gh project view 27 --owner tauri-apps gh api graphql -f query=' query($org: String!, $number: Int!) { organization(login: $org){ From 247a57523db418e78018cf9103ada386770fe7f1 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:31:26 +0200 Subject: [PATCH 05/10] prio --- .github/workflows/priority.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index f5cced9256..9aa70efeac 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -14,13 +14,16 @@ jobs: pull-requests: write issues: write steps: + - name: test + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh project view 27 --owner tauri-apps - name: Get project data env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} ORGANIZATION: tauri-apps PROJECT_NUMBER: 27 run: | - gh project view 27 --owner tauri-apps gh api graphql -f query=' query($org: String!, $number: Int!) { organization(login: $org){ From bea16c475ff5eb5e71f6553a00829f7a30e962d5 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:35:01 +0200 Subject: [PATCH 06/10] prio --- .github/workflows/priority.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index 9aa70efeac..a45dbcdd0d 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -13,6 +13,7 @@ jobs: permissions: pull-requests: write issues: write + contents: write steps: - name: test env: From 45942cb1784d6259ae3a24074f236ad6940f4dec Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 15:39:56 +0200 Subject: [PATCH 07/10] prio --- .github/workflows/priority.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index a45dbcdd0d..4153b1b339 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -17,7 +17,7 @@ jobs: steps: - name: test env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.TEST_TOKEN }} run: gh project view 27 --owner tauri-apps - name: Get project data env: From 12d0b0cfb9be5af106ca068a11931a89076f4dc6 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 17:38:29 +0200 Subject: [PATCH 08/10] prio --- .github/workflows/priority.yml | 91 +++++----------------------------- 1 file changed, 13 insertions(+), 78 deletions(-) diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index 4153b1b339..9bc1f8af3c 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -4,57 +4,24 @@ on: issues: types: [opened] pull_request: - #types: [opened] + types: [opened, reopened] jobs: set_statuses: runs-on: ubuntu-latest if: ${{ !contains(github.event.issue.labels.*.name, 'manual') && !contains(github.event.pull_request.labels.*.name, 'manual') }} - permissions: - pull-requests: write - issues: write - contents: write steps: - - name: test - env: - GH_TOKEN: ${{ secrets.TEST_TOKEN }} - run: gh project view 27 --owner tauri-apps - name: Get project data env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORGANIZATION: tauri-apps - PROJECT_NUMBER: 27 + GH_TOKEN: ${{ secrets.TEST_TOKEN }} run: | - gh api graphql -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectV2(number: $number) { - id - fields(first: 20) { - nodes { - ... on ProjectV2Field { - id - name - } - ... on ProjectV2SingleSelectField { - id - name - options { - id - name - } - } - } - } - } - } - }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json - echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'PRIORITY_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Priority") | .id' project_data.json) >> $GITHUB_ENV - echo 'LOW_PRIORITY_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Priority") | .options[] | select(.name=="Low") |.id' project_data.json) >> $GITHUB_ENV - echo 'MEDIUM_PRIORITY_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Priority") | .options[] | select(.name=="Medium") |.id' project_data.json) >> $GITHUB_ENV - echo 'HIGH_PRIORITY_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Priority") | .options[] | select(.name=="High") |.id' project_data.json) >> $GITHUB_ENV - echo 'CRITICAL_PRIORITY_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Priority") | .options[] | select(.name=="Critical") |.id' project_data.json) >> $GITHUB_ENV + echo "PROJECT_ID=$(gh project view 27 --owner tauri-apps --format json --jq '.id')" >> $GITHUB_ENV + gh project field-list 27 --owner tauri-apps --format json > project_data.json + echo 'PRIORITY_FIELD_ID='$(jq '.fields[] | select(.name== "Priority") | .id' project_data.json) >> $GITHUB_ENV + echo 'LOW_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Low") |.id' project_data.json) >> $GITHUB_ENV + echo 'MEDIUM_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Medium") |.id' project_data.json) >> $GITHUB_ENV + echo 'HIGH_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="High") |.id' project_data.json) >> $GITHUB_ENV + echo 'CRITICAL_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Critical") |.id' project_data.json) >> $GITHUB_ENV - name: Default priority run: | @@ -62,44 +29,12 @@ jobs: - name: Add/get item id env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.TEST_TOKEN }} run: | - if [ "${{ github.event.pull_request.node_id }}" != "" ]; then - echo "NODE_ID=${{ github.event.pull_request.node_id }}" >> $GITHUB_ENV - else - echo "NODE_ID=${{ github.event.issue.node_id }}" >> $GITHUB_ENV - fi - item_id=$(gh api graphql -f query=' - mutation($project: ID!, $node: ID!) { - addProjectV2ItemById(input: {projectId: $project, contentId: $node}) { - item { - id - } - } - }' -f project=$PROJECT_ID -f node=$NODE_ID --jq '.data.addProjectV2ItemById.item.id') - echo 'ITEM_ID='$item_id >> $GITHUB_ENV + echo "ITEM_ID=$(gh project item-add 27 --owner tauri-apps --url https://github.com/tauri-apps/tauri-docs/issues/${{ github.event.pull_request.number || github.event.issue.number }} --format json --jq '.id')" >> $GITHUB_ENV - name: Set fields env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.TEST_TOKEN }} run: | - gh api graphql -f query=' - mutation ( - $project: ID! - $item: ID! - $priority_field: ID! - $priority_value: String! - ) { - set_priority: updateProjectV2ItemFieldValue(input: { - projectId: $project - itemId: $item - fieldId: $priority_field - value: { - singleSelectOptionId: $priority_value - } - }) { - projectV2Item { - id - } - } - }' -f project=${{ env.PROJECT_ID }} -f item=${{ env.ITEM_ID }} -f priority_field=${{ env.PRIORITY_FIELD_ID }} -f priority_value=${{ env.PRIORITY_ID }} --silent + gh project item-edit --id ${{ env.ITEM_ID }} --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.PRIORITY_FIELD_ID }} --single-select-option-id ${{ env.PRIORITY_ID }} From 705a3b536bf5e71b379aee11184f11bdd6381670 Mon Sep 17 00:00:00 2001 From: FabianLars Date: Thu, 8 Aug 2024 17:51:43 +0200 Subject: [PATCH 09/10] status --- .github/workflows/assign.yml | 2 +- .github/workflows/priority.yml | 12 ++-- .github/workflows/status.yml | 109 +++++++-------------------------- 3 files changed, 29 insertions(+), 94 deletions(-) diff --git a/.github/workflows/assign.yml b/.github/workflows/assign.yml index 3ceec42cd1..d8dbb75fb9 100644 --- a/.github/workflows/assign.yml +++ b/.github/workflows/assign.yml @@ -2,7 +2,7 @@ name: 'Auto Assign' on: pull_request: - types: [opened, reopened] + types: [opened] jobs: auto_assign: diff --git a/.github/workflows/priority.yml b/.github/workflows/priority.yml index 9bc1f8af3c..eb614366dc 100644 --- a/.github/workflows/priority.yml +++ b/.github/workflows/priority.yml @@ -4,7 +4,7 @@ on: issues: types: [opened] pull_request: - types: [opened, reopened] + types: [opened] jobs: set_statuses: @@ -18,16 +18,16 @@ jobs: echo "PROJECT_ID=$(gh project view 27 --owner tauri-apps --format json --jq '.id')" >> $GITHUB_ENV gh project field-list 27 --owner tauri-apps --format json > project_data.json echo 'PRIORITY_FIELD_ID='$(jq '.fields[] | select(.name== "Priority") | .id' project_data.json) >> $GITHUB_ENV - echo 'LOW_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Low") |.id' project_data.json) >> $GITHUB_ENV - echo 'MEDIUM_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Medium") |.id' project_data.json) >> $GITHUB_ENV - echo 'HIGH_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="High") |.id' project_data.json) >> $GITHUB_ENV - echo 'CRITICAL_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Critical") |.id' project_data.json) >> $GITHUB_ENV + echo 'LOW_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Low") | .id' project_data.json) >> $GITHUB_ENV + echo 'MEDIUM_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Medium") | .id' project_data.json) >> $GITHUB_ENV + echo 'HIGH_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="High") | .id' project_data.json) >> $GITHUB_ENV + echo 'CRITICAL_PRIORITY_ID='$(jq '.fields[] | select(.name== "Priority") | .options[] | select(.name=="Critical") | .id' project_data.json) >> $GITHUB_ENV - name: Default priority run: | echo 'PRIORITY_ID='${{ env.LOW_PRIORITY_ID }} >> $GITHUB_ENV - - name: Add/get item id + - name: Add project item / Get item id env: GH_TOKEN: ${{ secrets.TEST_TOKEN }} run: | diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index c27e1d1d54..fe43e5e836 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -11,116 +11,51 @@ jobs: steps: - name: Get project data env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ORGANIZATION: tauri-apps - PROJECT_NUMBER: 27 - run: | - gh api graphql -f query=' - query($org: String!, $number: Int!) { - organization(login: $org){ - projectV2(number: $number) { - id - fields(first: 20) { - nodes { - ... on ProjectV2Field { - id - name - } - ... on ProjectV2SingleSelectField { - id - name - options { - id - name - } - } - } - } - } - } - }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json - echo 'PROJECT_ID='$(jq '.data.organization.projectV2.id' project_data.json) >> $GITHUB_ENV - echo 'STATUS_FIELD_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV - echo 'BACKLOG_STATUS_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🪵 Backlog") |.id' project_data.json) >> $GITHUB_ENV - echo 'READY_STATUS_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="💪 Ready") |.id' project_data.json) >> $GITHUB_ENV - echo 'IN_PROGRESS_STATUS_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="🏗️ In progress") |.id' project_data.json) >> $GITHUB_ENV - echo 'IN_REVIEW_STATUS_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="📋 In review") |.id' project_data.json) >> $GITHUB_ENV - echo 'DONE_STATUS_ID='$(jq '.data.organization.projectV2.fields.nodes[] | select(.name== "Status") | .options[] | select(.name=="✅ Done") |.id' project_data.json) >> $GITHUB_ENV - - - name: Add/get item id + GH_TOKEN: ${{ secrets.TEST_TOKEN }} + run: | + echo "PROJECT_ID=$(gh project view 27 --owner tauri-apps --format json --jq '.id')" >> $GITHUB_ENV + gh project field-list 27 --owner tauri-apps --format json > project_data.json + echo 'STATUS_FIELD_ID='$(jq '.fields[] | select(.name== "Status") | .id' project_data.json) >> $GITHUB_ENV + echo 'BACKLOG_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="🪵 Backlog") | .id' project_data.json) >> $GITHUB_ENV + echo 'READY_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="💪 Ready") | .id' project_data.json) >> $GITHUB_ENV + echo 'IN_PROGRESS_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="🏗️ In progress") | .id' project_data.json) >> $GITHUB_ENV + echo 'IN_REVIEW_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="📋 In review") | .id' project_data.json) >> $GITHUB_ENV + echo 'DONE_STATUS_ID='$(jq '.fields[] | select(.name== "Status") | .options[] | select(.name=="✅ Done") | .id' project_data.json) >> $GITHUB_ENV + + - name: Add project item / Get item id env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - if [ "${{ github.event.pull_request.node_id }}" != "" ]; then - echo "NODE_ID=${{ github.event.pull_request.node_id }}" >> $GITHUB_ENV - else - echo "NODE_ID=${{ github.event.issue.node_id }}" >> $GITHUB_ENV - fi - item_id=$(gh api graphql -f query=' - mutation($project: ID!, $node: ID!) { - addProjectV2ItemById(input: {projectId: $project, contentId: $node}) { - item { - id - } - } - }' -f project=$PROJECT_ID -f node=$NODE_ID --jq '.data.addProjectV2ItemById.item.id') - echo 'ITEM_ID='$item_id >> $GITHUB_ENV + GH_TOKEN: ${{ secrets.TEST_TOKEN }} + run: echo "ITEM_ID=$(gh project item-add 27 --owner tauri-apps --url https://github.com/tauri-apps/tauri-docs/issues/${{ github.event.pull_request.number || github.event.issue.number }} --format json --jq '.id')" >> $GITHUB_ENV #===== PULL REQUESTS =====# - name: Is In progress if: ${{ github.event_name == 'pull_request' && (github.event.pull_request.draft == true || github.event.pull_request.mergeable == false) }} - run: | - echo 'STATUS_ID='${{ env.IN_PROGRESS_STATUS_ID }} >> $GITHUB_ENV + run: echo 'STATUS_ID='${{ env.IN_PROGRESS_STATUS_ID }} >> $GITHUB_ENV - name: Is In review if: ${{ github.event_name == 'pull_request' && github.event.pull_request.draft == false && github.event.pull_request.mergeable == true }} - run: | - echo 'STATUS_ID='${{ env.IN_REVIEW_STATUS_ID }} >> $GITHUB_ENV + run: echo 'STATUS_ID='${{ env.IN_REVIEW_STATUS_ID }} >> $GITHUB_ENV #===== END PULL REQUESTS =====# #===== ISSUES =====# - name: Is Ready if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] != null && github.event.issue.milestone != null) }} - run: | - echo 'STATUS_ID='${{ env.READY_STATUS_ID }} >> $GITHUB_ENV + run: echo 'STATUS_ID='${{ env.READY_STATUS_ID }} >> $GITHUB_ENV - name: Is In progress if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] != null && github.event.issue.milestone != null && github.event.issue.assignees[0] != null) }} - run: | - echo 'STATUS_ID='${{ env.IN_PROGRESS_STATUS_ID }} >> $GITHUB_ENV + run: echo 'STATUS_ID='${{ env.IN_PROGRESS_STATUS_ID }} >> $GITHUB_ENV - name: Is In review if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] != null && github.event.issue.pull_request.merged_at != null) }} - run: | - echo 'STATUS_ID='${{ env.IN_REVIEW_STATUS_ID }} >> $GITHUB_ENV + run: echo 'STATUS_ID='${{ env.IN_REVIEW_STATUS_ID }} >> $GITHUB_ENV - name: Is Backlog if: ${{ github.event_name == 'issues' && (github.event.issue.labels[0] == null || github.event.issue.milestone == null || contains(github.event.issue.labels.*.name, 'upstream') || contains(github.event.issue.labels.*.name, 'discuss')) }} - run: | - echo 'STATUS_ID='${{ env.BACKLOG_STATUS_ID }} >> $GITHUB_ENV + run: echo 'STATUS_ID='${{ env.BACKLOG_STATUS_ID }} >> $GITHUB_ENV #===== END ISSUES =====# - name: Set fields env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - gh api graphql -f query=' - mutation ( - $project: ID! - $item: ID! - $status_field: ID! - $status_value: String! - ) { - set_status: updateProjectV2ItemFieldValue(input: { - projectId: $project - itemId: $item - fieldId: $status_field - value: { - singleSelectOptionId: $status_value - } - }) { - projectV2Item { - id - } - } - }' -f project=${{ env.PROJECT_ID }} -f item=${{ env.ITEM_ID }} -f status_field=${{ env.STATUS_FIELD_ID }} -f status_value=${{ env.STATUS_ID }} --silent + GH_TOKEN: ${{ secrets.TEST_TOKEN }} + run: gh project item-edit --id ${{ env.ITEM_ID }} --project-id ${{ env.PROJECT_ID }} --field-id ${{ env.STATUS_FIELD_ID }} --single-select-option-id ${{ env.STATUS_ID }} From a1969fcd6c073b965a2376fa1a898b04933b9980 Mon Sep 17 00:00:00 2001 From: Fabian-Lars Date: Thu, 8 Aug 2024 18:04:24 +0200 Subject: [PATCH 10/10] Update status.yml --- .github/workflows/status.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index fe43e5e836..417216cfea 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -2,7 +2,7 @@ name: 'Status Updater' on: issues: - pull_request: + pull_request_target: jobs: set_statuses: