Skip to content

Commit

Permalink
chore: add generate sidebar script
Browse files Browse the repository at this point in the history
  • Loading branch information
daxiongya committed Jun 24, 2024
1 parent 676c3d8 commit 300a124
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/sync-tutorials.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Sync Tutorials
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *' # 每天运行一次
- cron: '0 0 * * 0' // 每周运行一次

jobs:
sync-tutorials:
Expand Down Expand Up @@ -32,6 +32,9 @@ jobs:
echo "::set-output name=changes::$temp"
rm temp.txt
- name: Generate Sidebar
run: npm run generate:sidebar

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
Expand Down
5 changes: 5 additions & 0 deletions sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ jq -c '.[]' $CONFIG_FILE | while read -r repo; do
fi
done

# generate new sidebar
npm run generate:sidebar

# # 添加更改到 git
git add docs/
git add changes.txt
git add sidebar.json
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git commit -m "Update tutorials" || echo "No changes to commit"

0 comments on commit 300a124

Please sign in to comment.