mirror of
https://github.com/creyD/autopep8_action.git
synced 2026-04-14 12:20:32 +02:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4db3b98ca0 | |||
| 08c429cdb4 | |||
| 3aac0062d0 | |||
| 421e07b203 | |||
| e6bb938eaf | |||
| 6ab9bc834c |
10
README.md
10
README.md
@@ -9,10 +9,12 @@ The following parameters can be used in your custom action configuration.
|
|||||||
| Parameter | Required | Default | Description |
|
| Parameter | Required | Default | Description |
|
||||||
| - | - | - | - |
|
| - | - | - | - |
|
||||||
| commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message|
|
| commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message|
|
||||||
| 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`|
|
||||||
| dependencies | :x: | 'false' | Path for the repositories 'requirements.txt'. If you have none, you may skip this.|
|
| 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.|
|
| 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
|
### Example
|
||||||
|
|
||||||
|
|||||||
11
action.yml
11
action.yml
@@ -18,10 +18,17 @@ inputs:
|
|||||||
dependencies:
|
dependencies:
|
||||||
description: Path for the repositories 'requirements.txt'. If you have none, you may skip this.
|
description: Path for the repositories 'requirements.txt'. If you have none, you may skip this.
|
||||||
required: false
|
required: false
|
||||||
default: 'false'
|
default: 'requirements.txt'
|
||||||
branch:
|
branch:
|
||||||
description: Branch which the changes are merged to
|
description: Branch which the changes are merged to
|
||||||
required: true
|
required: true
|
||||||
|
checkpath:
|
||||||
|
description: Path autopep8 checks
|
||||||
|
required: false
|
||||||
|
default: '.'
|
||||||
|
autoparameters:
|
||||||
|
description: Parameters for autopep8
|
||||||
|
required: false
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
@@ -32,6 +39,8 @@ runs:
|
|||||||
- ${{ inputs.file_pattern }}
|
- ${{ inputs.file_pattern }}
|
||||||
- ${{ inputs.dependencies }}
|
- ${{ inputs.dependencies }}
|
||||||
- ${{ inputs.branch }}
|
- ${{ inputs.branch }}
|
||||||
|
- ${{ inputs.checkpath }}
|
||||||
|
- ${{ inputs.autoparameters }}
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'fast-forward'
|
icon: 'fast-forward'
|
||||||
|
|||||||
11
entrypoint.sh
Normal file → Executable file
11
entrypoint.sh
Normal file → Executable file
@@ -19,19 +19,16 @@ EOF
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Installing dependencies..."
|
echo "Installing dependencies..."
|
||||||
pip install --upgrade pip
|
pip install -q --upgrade pip
|
||||||
# Install dependencies
|
# Install dependencies
|
||||||
pip install autopep8
|
pip install -q autopep8
|
||||||
|
|
||||||
# Install custom project dependencies if applicable
|
# Install custom project dependencies if applicable
|
||||||
if ! $INPUT_DEPENDENCIES == "false"
|
pip install -r $INPUT_DEPENDENCIES || echo "No dependency file found."
|
||||||
then
|
|
||||||
pip install -r $INPUT_DEPENDENCIES
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Apply PEP 8
|
# Apply PEP 8
|
||||||
echo "Running autopep8..."
|
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
|
if ! git diff --quiet
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user