Skip to content

Commit 37f7747

Browse files
Correctly use github workflow output
1 parent fee01e7 commit 37f7747

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

.github/workflows/commit-sqlx-changes.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
if: ${{ github.event.pull_request.merged }}
2727
runs-on: ubuntu-latest
2828
outputs:
29-
output1: $
29+
need_pr: ${{ steps.sqlx_check.outputs.need_pr }}
3030
steps:
3131
- uses: actions/checkout@v5
3232

@@ -55,11 +55,14 @@ jobs:
5555
run: cargo sqlx migrate run --database-url $DOCSRS_DATABASE_URL
5656

5757
- name: Commit sqlx changes on master branch if any
58+
id: sqlx_check
5859
run: |
5960
just sqlx-prepare
6061
# If there are differences in the SQLX files, then we push them on the master branch
6162
if git status --porcelain .sqlx ; then
62-
echo "need_pr" >> "$GITHUB_OUTPUT"
63+
echo "need_pr=1" >> "$GITHUB_OUTPUT"
64+
else
65+
echo "need_pr=0" >> "$GITHUB_OUTPUT"
6366
fi
6467
6568
- name: Clean up the database
@@ -69,11 +72,9 @@ jobs:
6972
if: ${{ github.event.pull_request.merged }}
7073
needs: commit-sqlx-changes
7174
runs-on: ubuntu-latest
72-
env:
73-
OUTPUT1:
7475
steps:
7576
- name: Open pull request
76-
if: ${{ needs.commit-sqlx-changes.outputs.output1 == 'need_or' }}
77+
if: ${{ needs.commit-sqlx-changes.outputs.need_pr == '1' }}
7778
uses: peter-evans/create-pull-request@v7
7879
with:
7980
commit-message: Update SQLX files

0 commit comments

Comments
 (0)