diff --git a/README.md b/README.md index 9fa373f..b1e470e 100644 --- a/README.md +++ b/README.md @@ -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 ./... +``` diff --git a/action.yml b/action.yml index 93d3c70..8d442fb 100644 --- a/action.yml +++ b/action.yml @@ -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$::')