Fetch and commit Notion changes #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Notion and commit changes | |
on: | |
workflow_dispatch: | |
inputs: | |
commit_message: | |
type: string | |
description: Commit message to use for this content build step | |
required: false | |
jobs: | |
notion_and_deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "latest" | |
- name: Run install | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
- name: Run Notion script | |
env: | |
NOTION_SECRET: ${{ secrets.NOTION_SECRET }} | |
run: | | |
node index.js | |
git add . | |
- name: Commit Changes | |
uses: planetscale/[email protected] | |
with: | |
commit_message: ${{ github.event.inputs.commit_message || 'Update from Notion' }} | |
repo: ${{ github.repository }} | |
branch: ${{ github.head_ref || github.ref_name }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |