File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -33,14 +33,25 @@ jobs:
33
33
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
34
34
DEV_PROJECT_ID : ${{ secrets.DEV_PROJECT_ID }}
35
35
run : |
36
+ project_number=$(echo $DEV_PROJECT_ID | jq -r '.split("/")[-1]') # Optional if $DEV_PROJECT_ID is full URL, otherwise remove this line.
36
37
columns=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
37
- -H "Accept: application/vnd.github.v3 +json" \
38
- "https://api.github.com/projects/$DEV_PROJECT_ID /columns")
39
-
40
- echo "Columns Response : $columns"
38
+ -H "Accept: application/vnd.github.inertia-preview +json" \
39
+ "https://api.github.com/projects/$project_number /columns")
40
+
41
+ echo "Columns response : $columns"
41
42
42
- column_id=$(echo $columns | jq -r 'map(select(.name == "No Status")) | .[0].id')
43
- echo "COLUMN_ID=$column_id" >> $GITHUB_ENV
43
+ if echo "$columns" | jq -e . >/dev/null 2>&1; then
44
+ column_id=$(echo $columns | jq -r '.[] | select(.name=="No Status") | .id')
45
+ if [ -n "$column_id" ]; then
46
+ echo "COLUMN_ID=$column_id" >> $GITHUB_ENV
47
+ else
48
+ echo "No column found with the name 'No Status'."
49
+ exit 1
50
+ fi
51
+ else
52
+ echo "Failed to parse columns response as JSON."
53
+ exit 1
54
+ fi
44
55
45
56
- name : Add issue to project
46
57
env :
You can’t perform that action at this time.
0 commit comments