-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (33 loc) · 1.03 KB
/
memberDataUpdate.yml
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
40
41
42
name: Run Notion API Script
on:
# push:
# branches:
# - main
workflow_dispatch:
jobs:
run_script:
runs-on: ubuntu-latest
environment: Notion-access
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up environment variables
run: |
echo "NOTION_TOKEN=${{ secrets.Notion_Token }}" >> $GITHUB_ENV
echo "NOTION_DATABASE_ID=${{ secrets.Notion_Database_ID }}" >> $GITHUB_ENV
- name: Run script
run: python .github/Scripts/StoreNotionDB.py
- name: Commit and push changes
run: |
cd $GITHUB_WORKSPACE
git config user.email "actions@github.com"
git config user.name "GitHub Actions"
# Check if there are changes to commit
if [[ -n $(git status --porcelain) ]]; then
git add .
git commit -m "Update Notion API data and commit history"
git push origin master
fi
env:
NOTION_TOKEN: ${{ secrets.Notion_Token }}
NOTION_DATABASE_ID: ${{ secrets.Notion_Database_ID }}