diff --git a/.github/workflows/reusable-go-test.yml b/.github/workflows/reusable-go-test.yml index 768b4ab..0d8ba66 100644 --- a/.github/workflows/reusable-go-test.yml +++ b/.github/workflows/reusable-go-test.yml @@ -12,6 +12,13 @@ on: type: string description: | extra args to pass `go test` + upload: + required: false + default: false + type: boolean + description: | + set to true to push test coverage as an artifact + jobs: go-test: runs-on: ubuntu-latest @@ -41,7 +48,7 @@ jobs: go tool cover -html=/tmp/coverage.out -o /tmp/coverage.html - name: Upload test log uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 - if: always() + if: ${{ inputs.upload }} with: name: test-results path: | diff --git a/README.md b/README.md index 7cf6424..5c9c0bd 100644 --- a/README.md +++ b/README.md @@ -607,7 +607,7 @@ jobs: uses: GeoNet/Actions/.github/workflows/reusable-go-test.yml@main ``` -test coverage results upload to job artifacts, found at the bottom of a job summary page. +test coverage results can be uploaded to job artifacts, found at the bottom of a job summary page. ### Go vulnerability check