codacy / codacy-analysis-cli-action

GitHub Action for the codacy-analysis-cli
https://github.com/codacy/codacy-analysis-cli
Apache License 2.0
58 stars 18 forks source link

[TS-290] in run-staticcheck step, build fail if we have unmatched go version #109

Closed ghost closed 1 year ago

ghost commented 1 year ago

I am using go1.18 in my project, and in the previous steps, I have used actions/setup-go@v2 with go-version 1.18. to run codacy analysis CLI, the static-check still give me no option to use go1.20. I saw the shell script change 3 days ago and yesterday there is a fix version. I can live with the update but I need an option inside of staticcheck to set go version.

github-actions[bot] commented 1 year ago

Internal ticket created : TS-290

ghost commented 1 year ago

when I update actions/setup-go@v3, it will pass. But this static check still need to based on client pointed go version check and becomes meaningful. Attachment of part of my action:

  codacy-analysis-cli:
    name: Codacy Analysis CLI
    runs-on: ubuntu-latest
    timeout-minutes: 15
    env:
      GO111MODULE: on
      GOPRIVATE: github.com/company/*
      GONOSUMDB: github.com/company/*
    steps:
      - name: Checkout code
        uses: actions/checkout@main

      - name: Setup GoLang
        uses: actions/setup-go@v3
        with:
          go-version: 1.18 # The Go version to download (if necessary) and use.

      - name: Configure Git for Golang
        run: |
          git config --global url."https://${{ secrets.CODACY_GH_TOKEN }}:x-oauth-basic@github.com/company".insteadOf "https://github.com/company"

      - name: Run Codacy Analysis CLI
        uses: codacy/codacy-analysis-cli-action@master
        with:
          run-staticcheck: true
          run-gosec: true
          skip-uncommitted-files-check: true
          allow-network: true
          api-token: ${{ secrets.CODACY_API }}
          upload: true
          max-allowed-issues: 2147483647
DMarinhoCodacy commented 1 year ago

Hello @changsheng-liu-od

Thanks for reporting this.

What kind of error are you receiving? We use go 1.20.2 in the script to install staticcheck and have better compatibility with the latest changes in the language.

Kind regards, David Marinho