Skip to content

Action failed in [email protected] #759

@ras0q

Description

@ras0q

Welcome

  • Yes, I understand that the GitHub action repository is not the repository of golangci-lint itself.
  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've included all information below (version, config, etc).

Description of the problem

If you specified --timeout option in a workflow file as follows,

- uses: golangci/golangci-lint-action@v3
  with:
      args: '--timeout=1m'

you will got the error even though depguard is disabled.
This error will occur only in GitHub Actions (success in my local PC).

run golangci-lint
  Running [/home/runner/golangci-lint-1.53.0-linux-amd64/golangci-lint run --out-format=github-actions --timeout=1m --verbose] in [] ...
  level=error msg="[linter] depguard: create analyzer: couldn't expand $gostd: could not read GOROOT directory: open src: no such file or directory\nmust have an Allow and/or Deny package list"

I am assuming that golangci/golangci-lint#3795 is the cause.

Version of golangci-lint

v1.53.0

Version of the GitHub Action

v3

Workflow file

name: CI

on:
  push:
    branches:
      - '**'
      - '!main'
    tags-ignore:
      - '**'

jobs:
  build:
    name: Build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: ./go.mod
      - run: go mod download
      - run: go build -v ./...

  test-unit:
    name: Unit Test
    runs-on: ubuntu-latest
    needs: build
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: ./go.mod
      - run: go test -v $(go list ./... | grep -v "/infra/")

  test-repo:
    name: Repository Test
    runs-on: ubuntu-latest
    needs: build
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: ./go.mod
      - name: Run repository tests
        run: |
          go test -v ./infra...
  golangci-lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-go@v4
        with:
          go-version-file: ./go.mod
      - uses: golangci/golangci-lint-action@v3
        with:
          args: '--timeout=1m --verbose'

Go version

1.20.4

Code example or link to a public repository

https://github.com/traPtitech/knoQ

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsupstreamrelated the golangci-lint but not to the action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions