mirror of
https://github.com/creyD/autopep8_action.git
synced 2026-04-14 04:10:31 +02:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| fc2267b495 | |||
| 3b42b54814 | |||
| d36ec0e312 |
@@ -1,9 +1,9 @@
|
|||||||
FROM node:lts-alpine3.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 pip3 install --no-cache-dir -q --upgrade pip
|
||||||
RUN pip install --no-cache-dir -q autopep8
|
RUN pip3 install --no-cache-dir -q autopep8
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
ENTRYPOINT ["/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 |
|
| commit_options | :x: | - | Custom git commit options |
|
||||||
| file_pattern | :x: | '*' | Custom file pattern for `git add` |
|
| file_pattern | :x: | '*' | Custom file pattern for `git add` |
|
||||||
| checkpath | :x: | '.' | The path autopep8 checks |
|
| checkpath | :x: | '.' | The path autopep8 checks |
|
||||||
|
| no_commit | :x: | False | Avoid committing, if used in a pipeline |
|
||||||
| options | :x: | ' ' | Parameters to use with autopep8 |
|
| 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. |
|
| 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?
|
description: Should this script apply autopep8 directly or just warn?
|
||||||
required: false
|
required: false
|
||||||
default: false
|
default: false
|
||||||
|
no_commit:
|
||||||
|
description: Can be used to avoid committing the changes
|
||||||
|
required: false
|
||||||
|
default: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
|
|||||||
@@ -28,6 +28,10 @@ _git_changed() {
|
|||||||
echo "Running autopep8..."
|
echo "Running autopep8..."
|
||||||
autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!"
|
autopep8 -i -r $INPUT_CHECKPATH $INPUT_OPTIONS || echo "Problem running autopep8!"
|
||||||
|
|
||||||
|
if $INPUT_NO_COMMIT; then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
if _git_changed;
|
if _git_changed;
|
||||||
then
|
then
|
||||||
if $INPUT_DRY; then
|
if $INPUT_DRY; then
|
||||||
|
|||||||
Reference in New Issue
Block a user