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

How to fix Parameter token or opts.auth is required #166

Open
pickaxe828 opened this issue Feb 3, 2023 · 4 comments
Open

How to fix Parameter token or opts.auth is required #166

pickaxe828 opened this issue Feb 3, 2023 · 4 comments

Comments

@pickaxe828
Copy link

pickaxe828 commented Feb 3, 2023

Expected:

No error

What's actually happening:

The original action
Part of the associated .yml:

- name: Bump version and push tag
  id: tag_version
  uses: mathieudutour/[email protected]
  with:
    github_token: ${{ inputs.github_token }}

Output:

Run mathieudutour/[email protected]
    default_bump: patch
    default_prerelease_bump: prerelease
    tag_prefix: v
    release_branches: master,main
    create_annotated_tag: false
    fetch_all_tags: false
    dry_run: false
Error: Parameter token or opts.auth is required

And stopped running.

So what is token actually? I've tried adding the GitHub token to it

uses: mathieudutour/[email protected]
with:
  github_token: ${{ inputs.github_token }}
@hemant-kr-meena
Copy link

hemant-kr-meena commented Mar 9, 2023

  • you should use ${{ secrets.GITHUB_TOKEN }} instead of ${{ inputs.github_token }}
  • there is no variable exists like ${{ inputs.github_token }} in workflows environment.

you can use this example

- name: Bump version and push tag
  id: tag_version
  uses: mathieudutour/[email protected]
  with:
    github_token: ${{ secrets.GITHUB_TOKEN }}
  • hope this will help you.

@yp28
Copy link

yp28 commented Jun 12, 2023

I am hitting this issue as well, using a personal access token. It previously worked with the exact same configuration. My code is as follows:

name: on-push-main
on:
  push:
    branches:
      - main

jobs:
  tagging:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: mathieudutour/[email protected]
        with:
          github_token: ${{ secrets.PAT }}
          fetch_all_tags: true
          release_branches: main

Nothing relevant changed, and the access token is not expired.

@yp28
Copy link

yp28 commented Jun 12, 2023

Diving just slightly deeper I found out this happened when the on-push-main workflow was triggered by dependabot[bot] rather than an actual user. Something weird happens that causes the error to occur.

It's a non-issue for me, since this shouldn't happen in my workflows, usually. Upon pushing from an actual user the action worked correctly.

@kivra-pauoli
Copy link

Slightly related: there's a dry_run option, but the action still requires a github_token. Is this by design (because the description only mentions "Required for permission to tag the repo.")? If the repository is already checked out can't the next tag be calculated without requiring the token? Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants