-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
30 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,16 +57,34 @@ runs: | |
with: | ||
version: v1.62.2 | ||
only-new-issues: true | ||
args: --out-format colored-line-number,checkstyle:${{ steps.set-working-directory.outputs.golangci-lint-working-directory }}_golangci-lint-report.xml -v | ||
args: --out-format colored-line-number,checkstyle:golangci-lint-report.xml -v | ||
working-directory: ${{ steps.set-working-directory.outputs.golangci-lint-working-directory }} | ||
- name: Print lint report artifact | ||
if: failure() | ||
shell: bashc | ||
run: cat ./${{ inputs.go-directory }}/${{ steps.set-working-directory.outputs.golangci-lint-working-directory }}_golangci-lint-report.xml | ||
shell: bash | ||
run: cat ./${{ inputs.go-directory }}/golangci-lint-report.xml | ||
- name: Get suffix for artifact name | ||
if: always() | ||
# This is needed set a valid name for the artifact in the upload step | ||
# It helps to avoid the error: | ||
# `The artifact name is not valid: golangci-lint-report-core/scripts Forward slash /` | ||
id: suffix | ||
shell: bash | ||
run: | | ||
echo "Verifying if suffix for '${{ inputs.go-directory }}' should be updated" | ||
go_directory="${{ inputs.go-directory }}" | ||
if [[ "$go_directory" == *\/* ]]; then | ||
suffix=$(echo "${go_directory}" | tr '/' '-') | ||
echo "Updated suffix for '${{ inputs.go-directory }}' to '${suffix}' | ||
else | ||
suffix=$(echo "${go_directory}") | ||
echo "No need to update suffix for '${go_directory}'" | ||
fi | ||
echo "suffix=${suffix}" | tee -a $GITHUB_OUTPUT | ||
- name: Store lint report artifact | ||
if: always() | ||
uses: actions/[email protected] | ||
with: | ||
name: golangci-lint-report-${{ inputs.go-directory }} | ||
name: golangci-lint-report-${{ steps.suffix.outputs.suffix }} | ||
# The ./ is needed to preserve the valid pattern for the artifact path | ||
path: ./${{ inputs.go-directory }}/${{ inputs.go-directory }}_golangci-lint-report.xml | ||
path: ./${{ inputs.go-directory }}/golangci-lint-report.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters