diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 1a39a2f..1b522f8 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -92,6 +92,15 @@ 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 + codespell: name: Check for spelling errors runs-on: ubuntu-latest diff --git a/README.md b/README.md index 0b39d2f..07b3e7a 100644 --- a/README.md +++ b/README.md @@ -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" +``` diff --git a/action.yml b/action.yml index 3439fc4..4c956d3 100644 --- a/action.yml +++ b/action.yml @@ -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: @@ -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 }}