Skip to content

Commit b273c53

Browse files
committed
Check for fixable changes
1 parent 1b3840c commit b273c53

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

action.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ runs:
7070
php-version: "${{ inputs.php-version }}"
7171
tools: composer:v2
7272

73+
# todo consider using cache
7374
- name: "Use the latest PHPCS version"
7475
run: composer require --dev squizlabs/php_codesniffer --prefer-dist --no-progress
7576
shell: bash
@@ -107,6 +108,15 @@ runs:
107108
108109
# restore composer.json before staging the changes
109110
git checkout composer.json
111+
112+
# Check for fixable changes
113+
if [ -z "$(git status --porcelain)" ]; then
114+
echo "::warning title=No fixable errors were found by phpcbf::Manual fix necessary. Compare to the PHP Code Sniffer section above."
115+
# Exiting gracefully
116+
exit 0
117+
# The rest of the script must still be within the same step to really stop the execution
118+
fi
119+
110120
git add .
111121
112122
# Determine branch name based on commit-changes input

0 commit comments

Comments
 (0)