Skip to content

Commit

Permalink
Test GH Workflow - Mark Under Review - Attempt node-red#28
Browse files Browse the repository at this point in the history
  • Loading branch information
joepavitt committed Mar 27, 2024
1 parent 2186aa1 commit ec2f538
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/record-in-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:
name: "Update Issue: Under Review"
runs-on: ubuntu-latest
steps:
- name: Get Today's Date
run: echo "DATE=$(date +"%Y-%m-%d")" >> $GITHUB_ENV
- name: Get Linked Issues
id: get_linked_issues
env:
Expand Down Expand Up @@ -52,13 +54,19 @@ jobs:
PROJECT_ID: PVT_kwHOBepif84AfH1x
STATUS_FIELD_ID: PVTSSF_lAHOBepif84AfH1xzgUjmnw
UNDER_REVIEW_OPTION_ID: 5fce39d2
INTO_REVIEW_FIELD_ID: PVTF_lAHOBepif84AfH1xzgUnkt0
run: |
item_ids=$(echo '${{ env.LINKED_ISSUE_IDs }}' | jq '.[] | .projectItems.nodes[] | select(.project.id == "${{ env.PROJECT_ID }}") | .id')
while read -r ISSUE_ITEM_ID; do
echo "ISSUE_ITEM_ID=$ISSUE_ITEM_ID"
updatedAt="$( gh api graphql -f query='
mutation($itemId:ID!, $projectId:ID!) {
updateProjectV2ItemFieldValue(
mutation(
$itemId:ID!,
$projectId:ID!,
$date_field: ID!
$date_value: Date!
) {
markUnderReview: updateProjectV2ItemFieldValue(
input: {
projectId: $projectId,
fieldId: "${{ env.STATUS_FIELD_ID }}",
Expand All @@ -73,6 +81,21 @@ jobs:
updatedAt
}
}
markIntoReviewDate: updateProjectV2ItemFieldValue(
input: {
projectId: $projectId,
fieldId: "${{ env.INTO_REVIEW_FIELD_ID }}",
itemId: $itemId,
value: {
text: $DATE
}
}
) {
projectV2Item {
type
updatedAt
}
}
}' -f itemId=$ISSUE_ITEM_ID -f projectId=$PROJECT_ID --jq '.data.updateProjectV2ItemFieldValue.projectV2Item.updatedAt')"
echo "Issues Updated @ $updatedAt"
done <<< "$item_ids"

0 comments on commit ec2f538

Please sign in to comment.