Iconpack Tree Writer #9279
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: Iconpack Tree Writer | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- "iconpacks/list.json" | |
- ".github/scripts/iconpack_tree_writer/**/*.*" | |
- ".github/workflows/iconpack_tree_writer.yml" | |
schedule: | |
- cron: "*/30 * * * *" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.ref }} | |
jobs: | |
write: | |
runs-on: ubuntu-latest | |
name: Write files | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: main | |
- uses: actions/checkout@v4 | |
with: | |
ref: iconpack-trees | |
path: trees | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- uses: pnpm/action-setup@v3 | |
with: | |
package_json_file: main/package.json | |
- working-directory: main | |
run: pnpm i | |
- name: Write trees | |
working-directory: main | |
run: node .github/scripts/iconpack_tree_writer/index.mjs | |
- name: Commit changes | |
working-directory: trees | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add . | |
if [ "${{ github.event_name }}" == "push" ]; then | |
git commit -m "chore: update iconpacks trees (${{ github.sha }})" | true | |
else | |
git commit -m "chore: update iconpacks trees" | true | |
fi | |
git pull | |
git push |