Skip to content

Commit

Permalink
Update 99-add-issue-to-project.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mfranzke authored Dec 11, 2024
1 parent 6547da0 commit f3f92d2
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions .github/workflows/99-add-issue-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,26 +27,22 @@ jobs:
}' -q .data.repository.issue.id)
echo "ISSUE_ID=$issue_id" >> $GITHUB_ENV
- name: Verify DEV_PROJECT_ID
- name: Verify access to organization project
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEV_PROJECT_ID: ${{ secrets.DEV_PROJECT_ID }}
ORG: ${{ github.repository_owner }}
DEV_PROJECT_ID: ${{ secrets.DEV_PROJECT_ID }}
run: |
result=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
"https://api.github.com/orgs/$ORG/projects/$DEV_PROJECT_ID")
-H "Accept: application/vnd.github.inertia-preview+json" \
"https://api.github.com/projects/$DEV_PROJECT_ID")
echo "Project response: $result"
if echo "$result" | jq -e . >/dev/null 2>&1; then
project_state=$(echo $result | jq -r '.state')
if [ "$project_state" != "open" ]; then
echo "Project is not open or not found"
exit 1
fi
echo "Verified project exists."
else
echo "Failed to parse project response as JSON."
echo "Failed to verify project existence."
exit 1
fi
Expand All @@ -55,7 +51,6 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEV_PROJECT_ID: ${{ secrets.DEV_PROJECT_ID }}
ORG: ${{ github.repository_owner }}
run: |
columns=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.inertia-preview+json" \
Expand All @@ -81,7 +76,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PROJECT_CARD_URL="https://api.github.com/projects/columns/$COLUMN_ID/cards"
# Create a project card for the issue in the specified column
curl -X POST -H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
Expand Down

0 comments on commit f3f92d2

Please sign in to comment.