-
Notifications
You must be signed in to change notification settings - Fork 6
39 lines (33 loc) · 1.07 KB
/
Copy pathnotion-sync.yml
File metadata and controls
39 lines (33 loc) · 1.07 KB
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
31
32
33
34
35
36
37
38
39
# .github/workflows/notion-sync.yml
name: Sync to Notion
on:
pull_request:
types: [closed]
branches:
- main
jobs:
sync-to-notion:
# PR이 실제로 merge 된 경우에만 실행
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
npm init -y
npm install @notionhq/client
- name: Sync to Notion
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
STUDY_SCHEDULE_DB_ID: ${{ secrets.STUDY_SCHEDULE_DB_ID }}
MEMBER_DB_ID: ${{ secrets.MEMBER_DB_ID }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_URL: ${{ github.event.pull_request.html_url }}
MERGED_AT: ${{ github.event.pull_request.merged_at }}
run: node scripts/sync-notion.js