Skip to content

Commit

Permalink
feat: "working_directory" parameter to adjust the current working dir…
Browse files Browse the repository at this point in the history
…ectory
  • Loading branch information
TrueBrain committed May 17, 2024
1 parent 6d09391 commit e4101d1
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,18 @@ jobs:
path: example_length
extra_arguments: "--max-line-length 90"

run_action_with_working_dir:
name: Test run action (working dir)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./
with:
working_directory: example_valid
path: example
only_warn: 1
max_line_length: 90

codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,3 +170,17 @@ steps:
with:
extra_arguments: "--hang-closing"
```

### Parameter: working_directory

Change the current working-directory to execute flake8 in.

This parameter is optional; by default it is set to ".".

```yaml
steps:
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
working_directory: "src"
```
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ inputs:
description: 'Extra arguments given to flake8'
required: false
default: ''
working_directory:
description: 'Working directory to run flake8 in'
required: false
default: '.'

runs:
using: 'composite'
steps:
Expand All @@ -55,13 +60,12 @@ runs:
shell: bash
- run: ${{ github.action_path }}/action/entrypoint.sh
shell: bash
working-directory: ${{ inputs.working_directory }}
env:
INPUT_PATH: ${{ inputs.path }}
INPUT_IGNORE: ${{ inputs.ignore }}
INPUT_MAX_LINE_LENGTH: ${{ inputs.max_line_length }}
INPUT_ONLY_WARN: ${{ inputs.only_warn }}
INPUT_FLAKE8_VERSION: ${{ inputs.flake8_version }}
INPUT_PLUGINS: ${{ inputs.plugins }}
INPUT_ERROR_CLASSES: ${{ inputs.error_classes }}
INPUT_WARNING_CLASSES: ${{ inputs.warning_classes }}
INPUT_EXTRA_ARGUMENTS: ${{ inputs.extra_arguments }}
Expand Down

0 comments on commit e4101d1

Please sign in to comment.