Skip to content

Commit c5ae6f9

Browse files
Merge pull request #473 from anuj123upadhyay/anuj123upadhyay-patch-2
Update update-readme.yml one more time
2 parents da6b762 + 18f5540 commit c5ae6f9

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

.github/workflows/update-readme.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ name: Update Repository structure
22

33
permissions:
44
contents: write
5-
5+
pull-requests: write
6+
67
on:
78
schedule:
89
- cron: '0 * * * *' # Run every hour
@@ -34,9 +35,19 @@ jobs:
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

0 commit comments

Comments
 (0)