Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: The file exists in scripts/golangci.yml, but it still gives an error #832

Closed
3 tasks done
cubxxw opened this issue Aug 23, 2023 · 1 comment
Closed
3 tasks done
Labels
question Further information is requested

Comments

@cubxxw
Copy link

cubxxw commented Aug 23, 2023

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

The file exists in scripts/golangci.yml, but it still gives an error, I don't know why, https://github.com/OpenIMSDK/Open-IM-Server/actions/runs/5948295706/job/16131814148?pr=921

Run golangci/golangci-lint-action@v3
prepare environment
run golangci-lint
Error: Failed to run: Error: working-directory (server) was not a path, Error: working-directory (server) was not a path
    at runLint (/home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:66817:19)
    at /home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:66849:53
    at Object.<anonymous> (/home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:2057:28)
    at Generator.next (<anonymous>)
    at /home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:1808:71
    at new Promise (<anonymous>)
    at __webpack_modules__.2186.__awaiter (/home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:1804:[12](https://github.com/OpenIMSDK/Open-IM-Server/actions/runs/5948295706/job/16131814148?pr=921#step:4:13))
    at Object.group (/home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:2053:12)
    at run (/home/runner/work/_actions/golangci/golangci-lint-action/v3/dist/run/index.js:66849:20)
    at runMicrotasks (<anonymous>)
Error: working-directory (server) was not a path

code:

name: OpenIM golangci-lint
on:
  push:
    branches: [main]
  pull_request:
jobs:
    golangci:
      name: lint
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v3
        - uses: actions/setup-go@v4
          with:
            go-version: '1.21'
            cache: false
        - name: golangci-lint
          uses: golangci/golangci-lint-action@v3.7.0
          with:
            # Require: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
            version: v1.53

            # Optional: working directory, useful for monorepos
            working-directory: server

            # Optional: golangci-lint command line arguments.
            # 
            # Note: by default the `.golangci.yml` file should be at the root of the repository.
            # The location of the configuration file can be changed by using `--config=`
            args: --timeout=30m --config=/scripts/golangci.yml  --issues-exit-code=0

            # Optional: show only new issues if it's a pull request. The default value is `false`.
            only-new-issues: true

            # Optional:The mode to install golangci-lint. It can be 'binary' or 'goinstall'.
            install-mode: "binary"

Version of golangci-lint

3.0

Version of the GitHub Action

no

Workflow file

<add you file here>

Go version

1.21

Code example or link to a public repository

// add your code here
@ldez ldez added the question Further information is requested label May 1, 2024
@ldez
Copy link
Member

ldez commented May 4, 2024

Error: working-directory (server) was not a path

It's because working-directory value is not a path.

@ldez ldez closed this as completed May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants