File tree Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Expand file tree Collapse file tree 1 file changed +26
-5
lines changed Original file line number Diff line number Diff line change 1919
2020permissions :
2121 contents : write
22+ pull-requests : write
2223
2324jobs :
2425 commit-sqlx-changes :
2526 if : ${{ github.event.pull_request.merged }}
2627 runs-on : ubuntu-latest
28+ outputs :
29+ output1 : $
2730 steps :
2831 - uses : actions/checkout@v4
2932
@@ -56,12 +59,30 @@ jobs:
5659 just sqlx-prepare
5760 # If there are differences in the SQLX files, then we push them on the master branch
5861 if git status --porcelain .sqlx ; then
59- git config --global user.name 'Docs.rs developers'
60- git config --global user.email 'docs.rs@users.noreply.github.com'
61- git add .sqlx
62- git commit -m 'Update SQLX files'
63- git push
62+ echo "need_pr" >> "$GITHUB_OUTPUT"
6463 fi
6564
6665 - name : Clean up the database
6766 run : docker compose down --volumes
67+
68+ create-pull-request :
69+ if : ${{ github.event.pull_request.merged }}
70+ needs : commit-sqlx-changes
71+ runs-on : ubuntu-latest
72+ steps :
73+ - env :
74+ OUTPUT1 : $
75+ - name : Open pull request
76+ if : ${{ OUTPUT1 == 'need_or' }}
77+ uses : peter-evans/create-pull-request@v7
78+ with :
79+ commit-message : Update SQLX files
80+ committer : Docs.rs developers <docs.rs@users.noreply.github.com>
81+ author : Docs.rs developers <docs.rs@users.noreply.github.com>
82+ signoff : false
83+ title : Update SQLX files
84+ delete-branch : true
85+ branch : update-sqlx-pr-${{ github.event.pull_request.number }}
86+ title : Update SQLX files after # ${{ github.event.pull_request.number }} changes
87+ body : |
88+ Following #${{ github.event.pull_request.number }} changes, here are the related SQLX files changes.
You can’t perform that action at this time.
0 commit comments