[WIP] [CI:DOCS] GHA: Add staticcheck workflow #1
Workflow file for this run
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
--- | ||
name: "Golang Static Check" | ||
on: ["push", "pull_request"] | ||
permissions: | ||
contents: read-all | ||
jobs: | ||
static_check: | ||
name: "Golang Static Check" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
# try to limit PR surprises by installing the project's minimum go verison | ||
- id: gomod | ||
run: | | ||
printf "version=%s" $(grep -Em1 '^go' go.mod | awk '{print $2}') >> $GITHUB_ENV | ||
- uses: WillAbides/setup-go-faster@v1.7.0 | ||
with: | ||
go-version: "^${{ steps.gomod.outputs.version }}" | ||
ignore-local: "true" | ||
# Ref: https://staticcheck.dev/docs/running-staticcheck/ci/github-actions/ | ||
- uses: dominikh/staticcheck-action@v1.2.0 | ||
with: | ||
# Renovate manages this value, manual changes are permitted if required. | ||
version: "2023.1.3" | ||
# Don't make suggestions for go versions older than the minimum | ||
min-go-version: "${{ steps.gomod.outputs.version }}" |