File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,8 @@ name: Update Repository structure
22
33permissions :
44 contents : write
5-
5+ pull-requests : write
6+
67on :
78 schedule :
89 - cron : ' 0 * * * *' # Run every hour
3435 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
3536 run : python .github/scripts/update_structure.py
3637
37- - name : Commit and push if changed
38+ - name : Commit changes
3839 run : |
39- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
40+ git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
4041 git config user.name "github-actions[bot]"
41- git add .
42- git diff --quiet && git diff --staged --quiet || (git commit -m "Update repo structure" && git push)
42+ git checkout -b update-structure
43+ git add .
44+ git commit -m "Update repo structure"
45+
46+ - name : Push changes and create PR
47+ env :
48+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49+ run : |
50+ git push origin update-structure
51+ curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
52+ -d '{"title":"Update repo structure","head":"update-structure","base":"main"}' \
53+ https://api.github.com/repos/${{ github.repository }}/pulls
You can’t perform that action at this time.
0 commit comments