6 Commits
v1.0 ... v1.2

Author SHA1 Message Date
4db3b98ca0 Fixed Readme Parameters 2019-11-15 09:41:03 +01:00
08c429cdb4 Added Custom Checkpath and Parameters Options 2019-11-15 09:38:54 +01:00
3aac0062d0 Added error catch for the dependency option 2019-11-15 00:37:42 +01:00
421e07b203 Added default value for dependency parameter 2019-11-15 00:34:55 +01:00
e6bb938eaf Attempt on fixing the "dependencies=false" bug
- Silenced pip installs
- Attempt on fixing the "dependencies=false" bug
2019-11-15 00:31:08 +01:00
6ab9bc834c Added +x permission on entrypoint script 2019-11-15 00:24:36 +01:00
3 changed files with 20 additions and 12 deletions

View File

@@ -9,10 +9,12 @@ The following parameters can be used in your custom action configuration.
| Parameter | Required | Default | Description |
| - | - | - | - |
| commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message|
| commit_options | :x: | '*' | Custom git commit options|
| file_pattern | :x: | '.' | Custom file pattern for `git add`|
| dependencies | :x: | 'false' | Path for the repositories 'requirements.txt'. If you have none, you may skip this.|
| branch | :white_check_mark: | - | The specific branch you want to merge into. Use ${{ github.head_ref }} if you want to use this with pull requests.|
| commit_options | :x: | - | Custom git commit options|
| file_pattern | :x: | '*' | Custom file pattern for `git add`|
| dependencies | :x: | 'requirements.txt' | Path for the repositories 'requirements.txt'. If you have none, you may skip this.|
| branch | :white_check_mark: | - | The specific branch you want to merge into. Use ${{ github.head_ref }} if you want to use this with pull requests. |
| checkpath | :x: | '.' | The path autopep8 checks |
| autoparameters | :x: | - | Parameters to use with autopep8 |
### Example

View File

@@ -18,10 +18,17 @@ inputs:
dependencies:
description: Path for the repositories 'requirements.txt'. If you have none, you may skip this.
required: false
default: 'false'
default: 'requirements.txt'
branch:
description: Branch which the changes are merged to
required: true
checkpath:
description: Path autopep8 checks
required: false
default: '.'
autoparameters:
description: Parameters for autopep8
required: false
runs:
using: 'docker'
@@ -32,6 +39,8 @@ runs:
- ${{ inputs.file_pattern }}
- ${{ inputs.dependencies }}
- ${{ inputs.branch }}
- ${{ inputs.checkpath }}
- ${{ inputs.autoparameters }}
branding:
icon: 'fast-forward'

11
entrypoint.sh Normal file → Executable file
View File

@@ -19,19 +19,16 @@ EOF
}
echo "Installing dependencies..."
pip install --upgrade pip
pip install -q --upgrade pip
# Install dependencies
pip install autopep8
pip install -q autopep8
# Install custom project dependencies if applicable
if ! $INPUT_DEPENDENCIES == "false"
then
pip install -r $INPUT_DEPENDENCIES
fi
pip install -r $INPUT_DEPENDENCIES || echo "No dependency file found."
# Apply PEP 8
echo "Running autopep8..."
autopep8 --in-place -r .
autopep8 --in-place -r $INPUT_CHECKPATH ${INPUT_AUTOPARAMETERS:+"$INPUT_AUTOPARAMETERS"} || echo "Problem running autopep8."
if ! git diff --quiet
then