From 7f458326eb26629163c4549fc83020e3cc2fa986 Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Thu, 7 Nov 2024 17:01:16 +0900 Subject: [PATCH] add auto-move-to-in-progress-on-assign.yml workflow --- .../auto-move-to-in-progress-on-assign.yml | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/auto-move-to-in-progress-on-assign.yml diff --git a/.github/workflows/auto-move-to-in-progress-on-assign.yml b/.github/workflows/auto-move-to-in-progress-on-assign.yml new file mode 100644 index 0000000..92c6bfa --- /dev/null +++ b/.github/workflows/auto-move-to-in-progress-on-assign.yml @@ -0,0 +1,20 @@ +name: Auto Move to In Progress on Assign +on: + issues: + types: + - assigned +jobs: + move-to-in-progress: + runs-on: ubuntu-latest + steps: + - name: Move Issue to In Progress + run: | + PROJECT_NODE_ID=$(gh project view --owner "${{ github.repository_owner }}" "${PROJECT_ID}" --format json --jq .id) + PROJECT_ITEM_ID=$(ISSUE_NUMBER="${{ github.event.issue.number }}" gh project item-list --owner "${{ github.repository_owner }}" "${PROJECT_ID}" --limit 100000 --format json --jq '.items[] | select(.content.repository == env.GITHUB_REPOSITORY and .content.number == (env.ISSUE_NUMBER | tonumber)) | .id') + gh project item-edit --project-id "${PROJECT_NODE_ID}" --id "${PROJECT_ITEM_ID}" --field-id "${STATUS_FIELD_ID}" --single-select-option-id "${IN_PROGRESS_STATUS_ID}" + env: + # read:org project + GITHUB_TOKEN: "${{ secrets.ADD_TO_PROJECT_PAT }}" + PROJECT_ID: "2" + STATUS_FIELD_ID: PVTSSF_lAHOABpmus0uuM4AAVPr + IN_PROGRESS_STATUS_ID: "98236657"