Skip to content

Daily Project to MD #65

Daily Project to MD

Daily Project to MD #65

name: Daily Project to MD
on:
schedule:
- cron: "0 16 * * *"
workflow_dispatch:
jobs:
export:
runs-on: ubuntu-latest
permissions:
contents: write
repository-projects: read
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GH_TOKEN }}
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Install deps
run: |
npm install
cd examples
npm install
- name: Export project to markdown
env:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: npx ts-node examples/project-to-md.ts examples/items
- name: Commit and push exported items
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add examples/items
if git diff --cached --quiet; then
echo "No changes to commit"
else
git commit -m "chore: export project items [skip ci]"
git push
fi