From b900400b71e3dd2c776f79b81ce27d554945b00e Mon Sep 17 00:00:00 2001 From: hossainemruz Date: Sat, 30 Oct 2021 02:07:18 +0600 Subject: [PATCH] Update workflow Signed-off-by: hossainemruz --- .github/workflows/project-automation-pr.yaml | 44 ++++++++++++-------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/.github/workflows/project-automation-pr.yaml b/.github/workflows/project-automation-pr.yaml index 401d10f..421d275 100644 --- a/.github/workflows/project-automation-pr.yaml +++ b/.github/workflows/project-automation-pr.yaml @@ -122,20 +122,30 @@ jobs: }' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$TYPE_ID" -f opt_id="$OPTION_ID" --silent fi - # - name: Set "Status" field - # env: - # GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}} - # run: | - # gh api graphql -f query=' - # mutation ($project: ID!, $item: ID!, $field: ID!, $status_id: ID!) { - # updateProjectNextItemField(input: { - # projectId: $project - # itemId: $item - # fieldId: $field - # value: $status_id - # }) { - # projectNextItem { - # id - # } - # } - # }' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$STATUS_ID" -f status_id="$STATUS_IN_PROGRESS" --silent + - name: Set "Status" field + env: + GITHUB_TOKEN: ${{secrets.PROJECT_AUTOMATION}} + run: | + MERGED=${{github.event.pull_request.merged}} + STATE=${{github.event.pull_request.state}} + REVIEWER=${{github.event.pull_request.requested_reviewers}} + DRAFT=${{github.event.pull_request.draft}} + + echo "Merged: $MERGED" + echo "State: $STATE" + echo "Draft: $DRAFT" + echo "Reviewer: $REVIEWER" + + gh api graphql -f query=' + mutation ($project: ID!, $item: ID!, $field: ID!, $status_id: ID!) { + updateProjectNextItemField(input: { + projectId: $project + itemId: $item + fieldId: $field + value: $status_id + }) { + projectNextItem { + id + } + } + }' -f project="$PROJECT_ID" -f item="$ITEM_ID" -f field="$STATUS_ID" -f status_id="$STATUS_IN_PROGRESS" --silent