wearerequired / lint-action

✨ GitHub Action for detecting and auto-fixing lint errors
MIT License
571 stars 138 forks source link

Fails with "unhandled promise rejection" when using SwiftLint #45

Closed Jeehut closed 4 years ago

Jeehut commented 4 years ago

I just tried to use this action for SwiftLint, but I'm getting this error:

null
/home/runner/work/_actions/samuelmeuli/lint-action/v1.5.0/src/index.js:13
    throw new Error(`Exiting because of unhandled promise rejection`);
    ^

Error: Exiting because of unhandled promise rejection
    at process.<anonymous> (/home/runner/work/_actions/samuelmeuli/lint-action/v1.5.0/src/index.js:13:8)
    at process.emit (events.js:210:5)
    at processPromiseRejections (internal/process/promises.js:201:33)
    at processTicksAndRejections (internal/process/task_queues.js:94:32)

Here's my job configuration:

  swiftlint:
    runs-on: ubuntu-latest
    steps:
    - name: Lint Action
      uses: samuelmeuli/lint-action@v1.5.0
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        swiftlint: true
samuelmeuli commented 4 years ago

Is your repo open source? Or would you be able to share the full log?

Jeehut commented 4 years ago

Unfortunately, it's private. If you can't reproduce it, I can try to setup a Demo project where it fails. But here's the full log:

2020-05-11T12:42:09.9597016Z ##[section]Starting: Request a runner to run this job
2020-05-11T12:42:10.3942106Z Requesting a hosted runner in current repository's account/organization with labels: 'ubuntu-latest', require runner match: True
2020-05-11T12:42:10.4878632Z Labels matched hosted runners has been found, waiting for one of them get assigned for this job.
2020-05-11T12:42:10.5001039Z ##[section]Finishing: Request a runner to run this job
2020-05-11T12:42:14.9968320Z Current runner version: '2.169.1'
2020-05-11T12:42:14.9992123Z ##[group]Operating System
2020-05-11T12:42:14.9992689Z Ubuntu
2020-05-11T12:42:14.9992877Z 18.04.4
2020-05-11T12:42:14.9993082Z LTS
2020-05-11T12:42:14.9993218Z ##[endgroup]
2020-05-11T12:42:14.9993405Z ##[group]Virtual Environment
2020-05-11T12:42:14.9993612Z Environment: ubuntu-18.04
2020-05-11T12:42:14.9993822Z Version: 20200430.1
2020-05-11T12:42:14.9994046Z Included Software: https://github.com/actions/virtual-environments/blob/ubuntu18/20200430.1/images/linux/Ubuntu1804-README.md
2020-05-11T12:42:14.9994281Z ##[endgroup]
2020-05-11T12:42:14.9995279Z Prepare workflow directory
2020-05-11T12:42:15.0182847Z Prepare all required actions
2020-05-11T12:42:15.0191841Z Download action repository 'samuelmeuli/lint-action@v1.5.0'
2020-05-11T12:42:17.1083950Z ##[group]Run samuelmeuli/lint-action@v1.5.0
2020-05-11T12:42:17.1084313Z with:
2020-05-11T12:42:17.1084839Z   github_token: ***
2020-05-11T12:42:17.1085010Z   swiftlint: true
2020-05-11T12:42:17.1085191Z   auto_fix: false
2020-05-11T12:42:17.1085347Z   git_name: Lint Action
2020-05-11T12:42:17.1085509Z   git_email: lint-action@samuelmeuli.com
2020-05-11T12:42:17.1085674Z   commit_message: Fix code style issues with ${linter}
2020-05-11T12:42:17.1085829Z   stylelint: false
2020-05-11T12:42:17.1085989Z   stylelint_extensions: css,sass,scss
2020-05-11T12:42:17.1086150Z   gofmt: false
2020-05-11T12:42:17.1086305Z   gofmt_extensions: go
2020-05-11T12:42:17.1086447Z   golint: false
2020-05-11T12:42:17.1086602Z   golint_extensions: go
2020-05-11T12:42:17.1086757Z   eslint: false
2020-05-11T12:42:17.1086910Z   eslint_extensions: js
2020-05-11T12:42:17.1087051Z   prettier: false
2020-05-11T12:42:17.1087218Z   prettier_extensions: css,html,js,json,jsx,md,sass,scss,ts,tsx,vue,yaml,yml
2020-05-11T12:42:17.1087402Z   xo: false
2020-05-11T12:42:17.1087562Z   xo_extensions: js
2020-05-11T12:42:17.1087717Z   black: false
2020-05-11T12:42:17.1087873Z   black_extensions: py
2020-05-11T12:42:17.1088013Z   flake8: false
2020-05-11T12:42:17.1088177Z   flake8_extensions: py
2020-05-11T12:42:17.1088332Z   mypy: false
2020-05-11T12:42:17.1088485Z   mypy_extensions: py
2020-05-11T12:42:17.1088627Z   rubocop: false
2020-05-11T12:42:17.1088783Z   rubocop_extensions: rb
2020-05-11T12:42:17.1088939Z   swiftformat: false
2020-05-11T12:42:17.1089099Z   swiftformat_extensions: swift
2020-05-11T12:42:17.1089245Z   swift_format_lockwood: false
2020-05-11T12:42:17.1089406Z   swift_format_lockwood_extensions: swift
2020-05-11T12:42:17.1089568Z   swift_format_official: false
2020-05-11T12:42:17.1089934Z   swift_format_official_extensions: swift
2020-05-11T12:42:17.1090098Z   swiftlint_extensions: swift
2020-05-11T12:42:17.1090244Z ##[endgroup]
2020-05-11T12:42:18.0271322Z null
2020-05-11T12:42:18.0273039Z /home/runner/work/_actions/samuelmeuli/lint-action/v1.5.0/src/index.js:13
2020-05-11T12:42:18.0273425Z    throw new Error(`Exiting because of unhandled promise rejection`);
2020-05-11T12:42:18.0273745Z    ^
2020-05-11T12:42:18.0273895Z 
2020-05-11T12:42:18.0274208Z Error: Exiting because of unhandled promise rejection
2020-05-11T12:42:18.0275208Z     at process.<anonymous> (/home/runner/work/_actions/samuelmeuli/lint-action/v1.5.0/src/index.js:13:8)
2020-05-11T12:42:18.0275582Z     at process.emit (events.js:210:5)
2020-05-11T12:42:18.0275881Z     at processPromiseRejections (internal/process/promises.js:201:33)
2020-05-11T12:42:18.0276207Z     at processTicksAndRejections (internal/process/task_queues.js:94:32)
2020-05-11T12:42:18.0276417Z 
2020-05-11T12:42:18.0276984Z Verifying setup for SwiftLint…
2020-05-11T12:42:18.0338881Z Cleaning up orphan processes
samuelmeuli commented 4 years ago

Have you installed SwiftLint?

samuelmeuli commented 4 years ago

I've fixed a bug responsible for the missing error message: fda5366.

Jeehut commented 4 years ago

@samuelmeuli No, I haven't installed SwiftLint, I was expecting this action to do it for me when I turn it on, isn't this the case?

samuelmeuli commented 4 years ago

No, see the usage guide and examples in the README. For my Swift projects, I'm using a Mintfile to have the same linter versions locally and in CI.

Jeehut commented 4 years ago

Thanks for the pointer, will check soon and report if I have any issues.