Skip to content

Commit

Permalink
make the working directory configurable (#6)
Browse files Browse the repository at this point in the history
Fixes #4.

Example run (with the line-counting fix (#5) applied): https://github.com/marten-seemann-test/target/actions/runs/1071003167
  • Loading branch information
marten-seemann authored Jul 27, 2021
1 parent 7254415 commit 17785d5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,13 @@ steps:
with:
run: go vet ./...
```
Optionally, the working directory can be specified, analagously to the [`working-directory` option on `run`](https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_iddefaultsrun):
```yml
steps:
- name: Code Quality Checks
uses: protocol/multiple-go-modules@master
with:
working-directory: scripts
run: go vet ./...
```
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ inputs:
run:
description: "Command(s) to run"
required: true
working-directory:
description: "working directory"
required: false

runs:
using: "composite"
steps:
- shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
status=0
dirs=$(find . \( -name vendor -o -name '[._].*' -o -name node_modules \) -prune -o -name go.mod -print | sed 's:/go.mod$::')
Expand Down

0 comments on commit 17785d5

Please sign in to comment.