mirror of
https://github.com/creyD/autopep8_action.git
synced 2026-04-12 19:40:28 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d36ec0e312 |
@@ -12,6 +12,7 @@ The following parameters can be used in your custom action configuration.
|
||||
| commit_options | :x: | - | Custom git commit options |
|
||||
| file_pattern | :x: | '*' | Custom file pattern for `git add` |
|
||||
| checkpath | :x: | '.' | The path autopep8 checks |
|
||||
| no_commit | :x: | False | Avoid committing, if used in a pipeline |
|
||||
| options | :x: | ' ' | Parameters to use with autopep8 |
|
||||
| dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. |
|
||||
|
||||
|
||||
@@ -27,6 +27,10 @@ inputs:
|
||||
description: Should this script apply autopep8 directly or just warn?
|
||||
required: false
|
||||
default: false
|
||||
no_commit:
|
||||
description: Can be used to avoid committing the changes
|
||||
required: false
|
||||
default: false
|
||||
|
||||
runs:
|
||||
using: 'docker'
|
||||
|
||||
@@ -28,6 +28,10 @@ _git_changed() {
|
||||
echo "Running autopep8..."
|
||||
autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!"
|
||||
|
||||
if $INPUT_NO_COMMIT; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if _git_changed;
|
||||
then
|
||||
if $INPUT_DRY; then
|
||||
|
||||
Reference in New Issue
Block a user