Auto Import 3rd Party Plugin Libraries #501
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: Auto Import 3rd Party Plugin Libraries | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
- libraries.json | |
- scripts | |
- '.github/workflows/update-library.yml' | |
schedule: | |
- cron: '0 1 * * *' | |
jobs: | |
import-and-commit: | |
runs-on: ubuntu-latest | |
permissions: | |
# Give the default GITHUB_TOKEN write permission to commit and push the | |
# added or changed files to the repository. | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/[email protected] | |
with: | |
node-version: '20' | |
- uses: pnpm/action-setup@v4 | |
with: | |
version: 'latest' | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Install dependencies | |
run: pnpm install | |
# Other steps that change files in the repository | |
- name: Import All Library in libraries.json | |
run: pnpm run importAllLibrary | |
- name: Import Latest Official Library | |
run: pnpm run importlibraryofficial | |
# Commit all changed files back to the repository | |
- uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: Automated Update all Library in libraries.json | |
file_pattern: 'tiddlers/*.*' | |
# commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]" | |
# commit_user_email: [email protected] # defaults to "41898282+github-actions[bot]@users.noreply.github.com" | |
commit_author: Github Action <[email protected]> # defaults to author of the commit that triggered the run | |
# Optional. Options used by `git-add`. | |
# See https://git-scm.com/docs/git-add#_options | |
# add_options: '-u' | |
# # Optional. Disable dirty check and always try to create a commit and push | |
skip_dirty_check: true | |
# # Optional. Skip internal call to `git fetch` | |
# skip_fetch: true | |
# # Optional. Skip internal call to `git checkout` | |
# skip_checkout: true | |
# Optional. Prevents the shell from expanding filenames. | |
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html | |
# disable_globbing: true | |
# push_options: --force |