diff --git a/.github/workflows/issue-triage.yml b/.github/workflows/issue-triage.yml index c4b94a9ac47..41d7bc8b32b 100644 --- a/.github/workflows/issue-triage.yml +++ b/.github/workflows/issue-triage.yml @@ -5,7 +5,6 @@ on: issue_comment: types: [created] env: - ISSUE_NUMBER: ${{ github.event.issue.number }} OWNER: ${{ github.repository_owner }} PROJECT_NUMBER: 39 @@ -27,19 +26,17 @@ jobs: - name: Get issue ID id: get_issue_id run: | - ISSUE_ID=$(gh project item-list $PROJECT_NUMBER --owner=$OWNER --limit=$ITEM_FETCH_LIMIT --format=json --jq '.items[] | select(.content.number == $ISSUE_NUMBER and .content.repository == "carbon-design-system/carbon-website") | .id') - if [ -z "$ISSUE_ID" ]; then - echo "Issue ID not found for issue number $ISSUE_NUMBER" - exit 1 - fi - echo "Issue ID is $ISSUE_ID" - echo "issue_id=$ISSUE_ID" >> "$GITHUB_OUTPUT" + ISSUE_ID=$(gh project item-list $PROJECT_NUMBER --owner=$OWNER --limit=$ITEM_FETCH_LIMIT --format=json --jq '.items[] | select(.content.number == '"${{ github.event.issue.number }}"' and .content.repository == "carbon-design-system/carbon-website") | .id') + if [ -z "$ISSUE_ID" ]; then + echo "Issue ID not found for issue number ${{ github.event.issue.number }}" + exit 1 + fi + echo "Issue ID is $ISSUE_ID" + echo "issue_id=$ISSUE_ID" >> "$GITHUB_OUTPUT" env: GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - name: Update issue with website area field - run: - gh project item-edit --project-id $PROJECT_ID --id $ISSUE_ID - --field-id $AREA_FIELD_ID --single-select-option-id $AREA_WEBSITE + run: | + gh project item-edit --project-id $PROJECT_ID --id ${{ steps.get_issue_id.outputs.issue_id }} --field-id $AREA_FIELD_ID --single-select-option-id $AREA_WEBSITE env: GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - $ISSUE_ID: ${{ steps.get_issue_id.outputs.issue_id }}