Skip to content

Commit 0605ac3

Browse files
authored
ci(cd): update gist transmission
1 parent da57c5c commit 0605ac3

File tree

1 file changed

+12
-9
lines changed

1 file changed

+12
-9
lines changed

.github/workflows/check-version.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
name: Check Next Version
2+
env:
3+
JSON_FILE: organized-next.json
24

35
on:
46
push:
@@ -45,9 +47,9 @@ jobs:
4547
echo "VERSION=$VERSION" >> $GITHUB_ENV
4648
echo "Extracted version: $VERSION"
4749
48-
- name: Create organized-next.json
50+
- name: Create $JSON_FILE
4951
run: |
50-
cat <<EOF > organized-next.json
52+
cat <<EOF > $JSON_FILE
5153
{
5254
"schemaVersion": 1,
5355
"label": "next version",
@@ -63,10 +65,11 @@ jobs:
6365
GIST_ID: 8d98acc3c934ff9dc191a0131135c4cb
6466
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
6567
run: |
66-
FILE_NAME="organized-next.json"
67-
cat $FILE_NAME
68-
JSON_CONTENT=$(jq -c . < $FILE_NAME)
69-
curl -X PATCH "https://api.github.com/gists/${GIST_ID}" \
70-
-H "Authorization: token ${GIST_TOKEN}" \
71-
-H "Content-Type: application/json" \
72-
-d "{\"files\": {\"$FILE_NAME\": {\"content\": \"$JSON_CONTENT\"}}}"
68+
JSON_CONTENT=$(jq -c . < $JSON_FILE)
69+
curl -L \
70+
-X PATCH \
71+
-H "Accept: application/vnd.github+json" \
72+
-H "Authorization: Bearer $GIST_TOKEN" \
73+
-H "X-GitHub-Api-Version: 2022-11-28" \
74+
https://api.github.com/gists/$GIST_ID \
75+
-d '$JSON_CONTENT'

0 commit comments

Comments
 (0)