Skip to content

Commit 4403f5a

Browse files
committed
updated sync yml
1 parent 3bffa32 commit 4403f5a

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

.github/workflows/sync-gist.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ jobs:
1616
env:
1717
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
1818
run: |
19-
FILE_CONTENT=$(cat notes/questions.md | jq -Rs .)
20-
GIST_ID=076468498c7f080b3a6d0c1f8c618b19
21-
22-
curl -X PATCH \
19+
set -e
20+
FILE_PATH="notes/questions.md"
21+
GIST_ID="076468498c7f080b3a6d0c1f8c618b19"
22+
GIST_FILENAME="00_ivs_questions.md" # Must match actual filename on Gist
23+
24+
FILE_CONTENT=$(cat "$FILE_PATH" | jq -Rs .)
25+
26+
curl -i -X PATCH \
2327
-H "Authorization: token $GIST_TOKEN" \
2428
-H "Accept: application/vnd.github+json" \
25-
-d "{\"files\": {\"questions.md\": {\"content\": $FILE_CONTENT}}}" \
26-
https://api.github.com/gists/$GIST_ID
29+
-d "{\"files\": {\"$GIST_FILENAME\": {\"content\": $FILE_CONTENT}}}" \
30+
"https://api.github.com/gists/$GIST_ID"

0 commit comments

Comments
 (0)