Skip to content

Commit

Permalink
simpler regen
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Sep 12, 2024
1 parent 0c5c04c commit af57ff3
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 89 deletions.
23 changes: 4 additions & 19 deletions .github/workflows/auto-regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:

auto-regenerate:
name: "Tries to regenerate the files"
name: "Auto Regenerate"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
Expand Down Expand Up @@ -43,24 +43,9 @@ jobs:
run: "composer dump-autoload"

- name: "Regenerate files"
run: "./safe.php generate"
run: "./safe.php generate && git diff --exit-code"
working-directory: "generator"

- name: "Check if regenerated files are different"
run: |
if output=$(git status --porcelain) && [ -z "$output" ]; then
# all is good
echo "Generated files are the same as committed file: OK"
else
# Uncommitted changes
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
echo "Detected changes:"
git status
git diff
echo "Generated files are different from commited files. Please run './safe.php generate' command and commit the results."
exit 1;
fi
- name: "Create a pr if the files are different"
if: ${{ failure() }}
uses: peter-evans/create-pull-request@v6
Expand All @@ -69,7 +54,7 @@ jobs:
branch: create-pull-request/regenerate-files
title: "Automatically regenerate the files"
labels: "regenerate, auto"
assignees: "kharhamel, moufmouf"
assignees: "shish"




Loading

0 comments on commit af57ff3

Please sign in to comment.