ataylorme / eslint-annotate-action

A GitHub action that takes ESLint results from a JSON file and adds them as annotated pull request comments
MIT License
88 stars 32 forks source link

Error: [@octokit/auth-action] The token variable is specified more than once. Use either `with.token`, `with.GITHUB_TOKEN`, or `env.GITHUB_TOKEN`. #76

Closed milimyname closed 2 months ago

milimyname commented 4 months ago

Hi everyone!

Thank u for the action!

However, it fails now... I wonder whether it is something to do with the latest updates?

Run ataylorme/eslint-annotate-action@v3
  with:
    report-json: eslint_report.json
    markdown-report-on-step-summary: true
    GITHUB_TOKEN: ***
    only-pr-files: true
    fail-on-warning: false
    fail-on-error: true
    check-name: ESLint Report Analysis
  env:
    GITHUB_TOKEN: ***
/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:[2](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:2)5[3](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:3)59
    throw new Error(
    ^

Error: [@octokit/auth-action] The token variable is specified more than once. Use either `with.token`, `with.GITHUB_TOKEN`, or `env.GITHUB_TOKEN`. See https://github.com/octokit/auth-action.js#createactionauth
    at createActionAuth2 (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:25359:11)
    at new Octokit (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:25595:20)
    at new OctokitWithDefaults (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:25510:11)
    at 90[4](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:4)2 (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:[5](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:5)[6](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:6)12[7](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:7):17)
    at __nccwpck_require__ (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:5[8](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:8)661:43)
    at 8481 (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:562[9](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:9)7:37)
    at __nccwpck_require__ (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:58661:43)
    at 6[14](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:15)4 (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:56540:45)
    at __nccwpck_require__ (/home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:58661:43)
    at /home/runner/work/_actions/ataylorme/eslint-annotate-action/v3/dist/index.js:58681:37

Node.js v[20](https://github.com/viadkt/energie-quartier/actions/runs/8046592630/job/21974115949#step:7:21).8.1
neumayr commented 4 months ago

Our Team encountered the same issue and we think it might have been caused by a commit on February 22nd in the v3 branch.

We then noticed that the 3.0.x branch doesn't have any official release tags yet. 🤔

Hey @ataylorme, I hope you're doing well. Would you happen to know if v3 is a work-in-progress branch or if it's considered stable? I would really appreciate your official recommendation.

Wanted to let you know that there are 100+ of Dependabot update pull requests available, suggest upgrading from v2 to v3. Just thought you might want to check it out! We merged ours without investigating further until the error occurred, so I wanted to share our experience with you.

ataylorme commented 4 months ago

Oh wow, yeah v3 branch is unstable and a work in progress. I’m not sure why Dependabot is making PRs when there isn’t a release. I’d recommend sticking with v2 for now. I’ll try to hurry up and get v3 finalized for a release. It will have breaking changes so just updating the referenced version won’t be enough

neumayr commented 4 months ago

📖 https://docs.github.com/en/actions/creating-actions/about-custom-actions#using-tags-for-release-management

The Docs suggest to name the branch with an -beta suffix. May this change will stop Dependabot create those Bump PRs.

ataylorme commented 4 months ago

I renamed the branch to add -beta. I will remove it after tagging a 3.0.0 release.

I honestly had no idea how many people are using this action. I’m glad to see the number is high but also disappointed for the issue with the new version.

The marketplace continued to show 2.2.0 as the latest even with the v3 branch so I thought it was fine. I appreciate you making me aware.

ataylorme commented 2 months ago

3.0.0 has been released. Please update any references to the v3 branch instead of v3-beta. Make sure to read the Changeling as there are breaking changes (GH_TOKEN input has changed)