Skip to content

Commit 2ef931a

Browse files
authored
Feature/notes (#8)
* java, spring, SQL, general interview questions notes * Add GitHub Action to sync gist
1 parent 73a1da1 commit 2ef931a

File tree

2 files changed

+1030
-0
lines changed

2 files changed

+1030
-0
lines changed

.github/workflows/sync-gist.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Sync Markdown to Gist
2+
3+
on:
4+
push:
5+
paths:
6+
- 'notes/questions.md'
7+
jobs:
8+
update-gist:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repo
13+
uses: actions/checkout@v3
14+
15+
- name: Update Gist content
16+
env:
17+
GIST_TOKEN: ${{ secrets.GIST_TOKEN }}
18+
run: |
19+
FILE_CONTENT=$(cat yourfile.md | jq -Rs .)
20+
GIST_ID=076468498c7f080b3a6d0c1f8c618b19
21+
22+
curl -X PATCH \
23+
-H "Authorization: token $GIST_TOKEN" \
24+
-d "{\"files\": {\"notes/questions.md\": {\"content\": $FILE_CONTENT}}}" \
25+
https://api.github.com/gists/$GIST_ID

0 commit comments

Comments
 (0)