Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions .github/workflows/update-readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Update Repository structure

permissions:
contents: write

pull-requests: write

on:
schedule:
- cron: '0 * * * *' # Run every hour
Expand Down Expand Up @@ -34,9 +35,19 @@ jobs:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python .github/scripts/update_structure.py

- name: Commit and push if changed
- name: Commit changes
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git diff --quiet && git diff --staged --quiet || (git commit -m "Update repo structure" && git push)
git checkout -b update-structure
git add .
git commit -m "Update repo structure"

- name: Push changes and create PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin update-structure
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-d '{"title":"Update repo structure","head":"update-structure","base":"main"}' \
https://api.github.com/repos/${{ github.repository }}/pulls
Loading