File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,16 +74,23 @@ jobs:
7474 - name : Check for changes
7575 id : changes
7676 run : |
77- if [ ! -f openapi.json ]; then
78- echo "has_changes=true" >> $GITHUB_OUTPUT
79- echo "New openapi.json file will be created"
80- elif git diff --quiet openapi.json 2>/dev/null; then
77+ # Check if file is new (untracked) or modified
78+ if ! git ls-files --error-unmatch openapi.json 2>/dev/null; then
79+ # File is not tracked by git - it's new
80+ if [ -f openapi.json ]; then
81+ echo "has_changes=true" >> $GITHUB_OUTPUT
82+ echo "New openapi.json file will be created"
83+ else
84+ echo "has_changes=false" >> $GITHUB_OUTPUT
85+ echo "Error: openapi.json was not generated"
86+ fi
87+ elif git diff --quiet openapi.json; then
8188 echo "has_changes=false" >> $GITHUB_OUTPUT
8289 echo "No changes detected in OpenAPI spec"
8390 else
8491 echo "has_changes=true" >> $GITHUB_OUTPUT
8592 echo "Changes detected in OpenAPI spec"
86- git diff --stat openapi.json 2>/dev/null || echo "New file"
93+ git diff --stat openapi.json
8794 fi
8895
8996 - name : Create Pull Request
You can’t perform that action at this time.
0 commit comments