Skip to content

Commit

Permalink
[ci] also split steps for auto-regen workflow
Browse files Browse the repository at this point in the history
If one of these steps fails, it's useful to know which one
  • Loading branch information
shish committed Jan 28, 2025
1 parent 767ba5d commit d1ec3ef
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/auto-regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,16 @@ jobs:
run: "composer dump-autoload"

- name: "Regenerate files"
id: regen
run: "./safe.php generate && git diff --exit-code && (echo regen=no-diff >> $GITHUB_OUTPUT) || (echo regen=diff >> $GITHUB_OUTPUT)"
run: "./safe.php generate"
working-directory: "generator"

- name: "Check for differences"
id: diff
run: "git diff --exit-code && (echo diff=no-diff >> $GITHUB_OUTPUT) || (echo diff=diff >> $GITHUB_OUTPUT)"
working-directory: "generator"

- name: "Create a pr if the files are different"
if: "${{ steps.regen.outputs.regen == 'diff' }}"
if: "${{ steps.diff.outputs.diff == 'diff' }}"
uses: peter-evans/create-pull-request@v6
with:
commit-message: "Automatically regenerate the files"
Expand Down

0 comments on commit d1ec3ef

Please sign in to comment.