Skip to content

Sync Content from Upstream #398

Sync Content from Upstream

Sync Content from Upstream #398

Workflow file for this run

name: Sync Content from Upstream
on:
schedule:
- cron: "0 0,6,12,18 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install dependencies
run: bun install
- name: Run sync script
run: bun run scripts/sync-upstream.ts
- name: Check for changes
id: changes
run: |
if [[ -n $(git status --porcelain content/) ]]; then
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "has_changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
COMMIT_SHA=$(cat .upstream-commit 2>/dev/null || echo "unknown")
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add content/
git commit -m "chore: sync content from upstream (${COMMIT_SHA:0:7})"
git push