Skip to content

Static code analysis checker for golang ๐Ÿ™

License

Notifications You must be signed in to change notification settings

convictional/golang-github-actions

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

67 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Golang GitHub Actions

static code analysis checker for golang. comments back on error to pull request.

Runs

Fmt

Runs gofmt and comments back on error. Fmt Action

Vet

Runs go vet and comments back on error.

Shadow

Runs go vet --vettool=/go/bin/shadow and comments back on error.
Use: golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow

Imports

Runs goimports and comments back on error.
Use: golang.org/x/tools/cmd/goimports Imports Action

Lint

Runs golint and comments back on error.
Use: golang.org/x/lint/golint Lint Action

Staticcheck

Runs staticcheck and comments back on error.
Use: honnef.co/go/tools/cmd/staticcheck Staticcheck Action

Errcheck

Runs errcheck and comments back on error.
Use: github.com/kisielk/errcheck Errcheck Action

Sec

Runs gosec and comments back on error.
Use: github.com/securego/gosec/cmd/gosec Sec Action

Sample Workflow

.github/workflows/static.yml

name: static check
on: pull_request

jobs:
  imports:
    name: Imports
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: check
      uses: grandcolline/[email protected]
      with:
        run: imports
        token: ${{ secrets.GITHUB_TOKEN }}

  errcheck:
    name: Errcheck
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: check
      uses: grandcolline/[email protected]
      with:
        run: errcheck
        token: ${{ secrets.GITHUB_TOKEN }}

  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: check
      uses: grandcolline/[email protected]
      with:
        run: lint
        token: ${{ secrets.GITHUB_TOKEN }}

  shadow:
    name: Shadow
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: check
      uses: grandcolline/[email protected]
      with:
        run: shadow
        token: ${{ secrets.GITHUB_TOKEN }}

  staticcheck:
    name: StaticCheck
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: check
      uses: grandcolline/[email protected]
      with:
        run: staticcheck
        token: ${{ secrets.GITHUB_TOKEN }}

  sec:
    name: Sec
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@master
    - name: check
      uses: grandcolline/[email protected]
      with:
        run: sec
        token: ${{ secrets.GITHUB_TOKEN }}
        flags: "-exclude=G104"

About

Static code analysis checker for golang ๐Ÿ™

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 89.6%
  • Dockerfile 10.4%