Skip to content

Commit

Permalink
feat: add go-directory inputs to ci-lint-go action (#169)
Browse files Browse the repository at this point in the history
* feat: add go-directory inputs to ci-lint-go action

* add go-directory for correct report path
  • Loading branch information
momentmaker authored Feb 14, 2024
1 parent 1bc7ce3 commit f94f14f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/clean-plums-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ci-lint-go": minor
---

Add working-directory flag for golangci-lint
11 changes: 7 additions & 4 deletions actions/ci-lint-go/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ inputs:
description: ""
required: false
default: --out-format checkstyle:golangci-lint-report.xml
go-directory:
description: ""
default: .

runs:
using: composite
Expand Down Expand Up @@ -127,23 +130,23 @@ runs:
# use-go-cache set to true
skip-pkg-cache: ${{ inputs.use-go-cache }}
skip-build-cache: ${{ inputs.use-go-cache }}

version: ${{ inputs.golangci-lint-version }}
args: ${{ inputs.golangci-lint-args }}
working-directory: ${{ inputs.go-directory }}

- name: Print lint report artifact
if: always()
shell: bash
run:
(test -f golangci-lint-report.xml && cat golangci-lint-report.xml) ||
true
(test -f ${{ inputs.go-directory }}/golangci-lint-report.xml && cat ${{
inputs.go-directory }}/golangci-lint-report.xml) || true

- name: Store lint report artifact
if: always()
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: golangci-lint-report
path: golangci-lint-report.xml
path: ${{ inputs.go-directory }}/golangci-lint-report.xml

- name: Collect metrics
if: always()
Expand Down

0 comments on commit f94f14f

Please sign in to comment.