2024-10-20 19:58:00 +02:00
|
|
|
name: Generate File Tree
|
2024-10-20 19:24:03 +02:00
|
|
|
|
|
|
|
on:
|
2024-10-20 19:47:59 +02:00
|
|
|
workflow_run:
|
2024-10-20 19:58:00 +02:00
|
|
|
workflows: ["Convert SVG Assets"]
|
2024-10-20 19:24:03 +02:00
|
|
|
branches:
|
|
|
|
- main
|
2024-10-20 19:34:53 +02:00
|
|
|
- dev
|
2024-10-20 19:47:59 +02:00
|
|
|
types:
|
|
|
|
- completed
|
2024-10-20 19:24:03 +02:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
generate_file_tree:
|
2024-10-20 19:47:59 +02:00
|
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
2024-10-20 19:24:03 +02:00
|
|
|
runs-on: ubuntu-latest
|
2024-10-20 19:37:43 +02:00
|
|
|
permissions:
|
|
|
|
contents: write
|
2024-10-20 19:24:03 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v3
|
2024-10-20 19:37:43 +02:00
|
|
|
with:
|
2024-10-20 19:47:59 +02:00
|
|
|
ref: ${{ github.event.workflow_run.head_branch }}
|
2024-10-20 19:24:03 +02:00
|
|
|
|
|
|
|
- name: Set Up Python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: "3.9"
|
|
|
|
|
|
|
|
- name: Generate File Tree
|
2024-10-20 19:47:59 +02:00
|
|
|
run: python scripts/generate_folder_tree.py svg png webp
|
2024-10-20 19:24:03 +02:00
|
|
|
|
|
|
|
- name: Commit and Push Changes
|
|
|
|
run: |
|
|
|
|
git config --global user.email "noreply@lammers.media"
|
|
|
|
git config --global user.name "Dashboard Icons Bot"
|
2024-10-20 19:45:46 +02:00
|
|
|
git add tree.json
|
2024-10-20 19:24:03 +02:00
|
|
|
git commit -m ":construction_worker: Generate file tree" || exit 0
|
2024-10-20 19:47:59 +02:00
|
|
|
git pull --rebase origin ${{ github.event.workflow_run.head_branch }}
|
|
|
|
git push origin HEAD:${{ github.event.workflow_run.head_branch }}
|