-
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
39 additions
and
11 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,37 @@ 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 validation is needed to set a valid name for the artifact suffix in the following "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 "Validating if '${{ inputs.go-directory }}' is a valid artifact suffix (no slashes)" | ||
go_directory="${{ inputs.go-directory }}" | ||
if [[ $go_directory == *\/* ]]; then | ||
suffix=$(echo "${go_directory}" | tr '/' '-') | ||
echo "Updated '${{ inputs.go-directory }}' to a valid artifact suffix '${suffix}'" | ||
else | ||
suffix="$go_directory" | ||
echo "No need to update artifact suffix '${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 }} | ||
# The workflows may generate multiple lint reports, | ||
# so we need to add a suffix to the name of the artifact | ||
# to avoid duplication-related errors | ||
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