Skip to content

Commit bb408e1

Browse files
Kumari LadliKumari Ladli
authored andcommitted
working notion-to-github
1 parent bd950ad commit bb408e1

7 files changed

Lines changed: 1123 additions & 86 deletions

File tree

.github/workflows/notion-sync.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,23 @@ jobs:
3030
run: node sync_notion.js
3131
env:
3232
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
33-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # default token to push changes
33+
34+
# Step 5: Commit and push to notion-to-github branch
35+
- name: Commit and push to branch
36+
run: |
37+
git config user.name "GitHub Actions"
38+
git config user.email "actions@github.com"
39+
git checkout -B notion-to-github
40+
git add .
41+
git diff --quiet && git diff --staged --quiet || git commit -m "Sync from Notion $(date +%Y-%m-%d)"
42+
git push -f origin notion-to-github
43+
44+
# Step 6: Create Pull Request
45+
- name: Create Pull Request
46+
uses: peter-evans/create-pull-request@v5
47+
with:
48+
token: ${{ secrets.GITHUB_TOKEN }}
49+
branch: notion-to-github
50+
base: main
51+
title: "Sync from Notion"
52+
body: "Automated sync from Notion workspace"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
.env
2+
node_modules/

0 commit comments

Comments
 (0)