-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (25 loc) · 836 Bytes
/
sync-gist.yml
File metadata and controls
30 lines (25 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
name: Sync Markdown to Gist
on:
push:
paths:
- 'notes/questions.md'
jobs:
update-gist:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Update Gist content
env:
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
run: |
set -e
FILE_PATH="notes/questions.md"
GIST_ID="076468498c7f080b3a6d0c1f8c618b19"
GIST_FILENAME="00_ivs_questions.md" # Must match actual filename on Gist
FILE_CONTENT=$(cat "$FILE_PATH" | jq -Rs .)
curl -i -X PATCH \
-H "Authorization: token $GIST_TOKEN" \
-H "Accept: application/vnd.github+json" \
-d "{\"files\": {\"$GIST_FILENAME\": {\"content\": $FILE_CONTENT}}}" \
"https://api.github.com/gists/$GIST_ID"