Skip to content

Open a PR if SQLX files need an update #2883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
31 changes: 26 additions & 5 deletions .github/workflows/commit-sqlx-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@ env:

permissions:
contents: write
pull-requests: write

jobs:
commit-sqlx-changes:
if: ${{ github.event.pull_request.merged }}
runs-on: ubuntu-latest
outputs:
output1: $
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -56,12 +59,30 @@ jobs:
just sqlx-prepare
# If there are differences in the SQLX files, then we push them on the master branch
if git status --porcelain .sqlx ; then
git config --global user.name 'Docs.rs developers'
git config --global user.email '[email protected]'
git add .sqlx
git commit -m 'Update SQLX files'
git push
echo "need_pr" >> "$GITHUB_OUTPUT"
fi

- name: Clean up the database
run: docker compose down --volumes

create-pull-request:
if: ${{ github.event.pull_request.merged }}
needs: commit-sqlx-changes
runs-on: ubuntu-latest
steps:
- env:
OUTPUT1: $
- name: Open pull request
if: ${{ OUTPUT1 == 'need_or' }}
uses: peter-evans/create-pull-request@v7
with:
commit-message: Update SQLX files
committer: Docs.rs developers <[email protected]>
author: Docs.rs developers <[email protected]>
signoff: false
title: Update SQLX files
delete-branch: true
branch: update-sqlx-pr-${{ github.event.pull_request.number }}
title: Update SQLX files after #${{ github.event.pull_request.number }} changes
body: |
Following #${{ github.event.pull_request.number }} changes, here are the related SQLX files changes.
Loading