3 Commits
v2.0 ... v3.0

Author SHA1 Message Date
fc2267b495 Adjusted pip commands for Python 3 2022-09-28 00:09:22 +02:00
3b42b54814 Updated to Python 3 2022-09-28 00:08:11 +02:00
d36ec0e312 Added no_commit option 2022-01-04 16:06:43 +01:00
4 changed files with 12 additions and 3 deletions

View File

@@ -1,9 +1,9 @@
FROM node:lts-alpine3.9
RUN apk update && apk add --no-cache bash git openssh python py-pip
RUN apk update && apk add --no-cache bash git openssh python3 py3-pip
RUN pip install --no-cache-dir -q --upgrade pip
RUN pip install --no-cache-dir -q autopep8
RUN pip3 install --no-cache-dir -q --upgrade pip
RUN pip3 install --no-cache-dir -q autopep8
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -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. |

View File

@@ -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'

View File

@@ -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