mirror of
https://github.com/creyD/autopep8_action.git
synced 2026-04-12 19:40:28 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc2267b495 | |||
| 3b42b54814 | |||
| d36ec0e312 |
@@ -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"]
|
||||
|
||||
@@ -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