Skip to content

Commit c1d6d96

Browse files
authored
Update sync-labels-with-project-status.yml
1 parent a64a179 commit c1d6d96

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/sync-labels-with-project-status.yml

+10-4
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ jobs:
1919
PR_NUMBER=${{ github.event.pull_request.number }}
2020
OWNER=${{ github.repository_owner }}
2121
REPO=${{ github.event.repository.name }}
22-
22+
2323
echo "Fetching Project Item ID..."
24-
24+
2525
ITEM_ID=$(gh api graphql -f query='
2626
query {
2727
repository(owner: "'"$OWNER"'", name: "'"$REPO"'") {
@@ -37,8 +37,14 @@ jobs:
3737
}
3838
}
3939
}' --jq '.data.repository.pullRequest.projectItems.nodes[] | select(.project.id=="'"$DEV_PROJECT_ID"'") | .id')
40-
41-
echo "Project Item ID: $ITEM_ID"
40+
41+
echo "Fetched ITEM_ID: $ITEM_ID"
42+
43+
if [[ -z "$ITEM_ID" ]]; then
44+
echo "❌ ERROR: No Project Item ID found! Please check the project association."
45+
exit 1
46+
fi
47+
4248
echo "ITEM_ID=$ITEM_ID" >> $GITHUB_ENV
4349

4450
- name: Debug – Get PR Project Status – Only __typename

0 commit comments

Comments
 (0)