From 08c429cdb4b55cf9712b15e2b77a2e27287b242b Mon Sep 17 00:00:00 2001 From: Conrad Date: Fri, 15 Nov 2019 09:38:54 +0100 Subject: [PATCH] Added Custom Checkpath and Parameters Options --- README.md | 4 +++- action.yml | 9 +++++++++ entrypoint.sh | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c4e1279..bdbbfe7 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ 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`| | 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 diff --git a/action.yml b/action.yml index 778dcc5..148588f 100644 --- a/action.yml +++ b/action.yml @@ -22,6 +22,13 @@ inputs: 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' diff --git a/entrypoint.sh b/entrypoint.sh index f0706a0..4c8d9c8 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -28,7 +28,7 @@ pip install -r $INPUT_DEPENDENCIES || echo "No dependency file found." # Apply PEP 8 echo "Running autopep8..." -autopep8 --in-place -r . || echo "Problem running autopep8." +autopep8 --in-place -r $INPUT_CHECKPATH ${INPUT_AUTOPARAMETERS:+"$INPUT_AUTOPARAMETERS"} || echo "Problem running autopep8." if ! git diff --quiet then