Skip to content

Action fails with Bad Credentials when using actions/github v3.0.0 #502

@Matticusau

Description

@Matticusau

Describe the bug
I am experiencing authentication problems from an Action which tries to trigger automated activities against a Pull Request or repo while using the @Actions/github v3.0.0 package.

To Reproduce
Steps to reproduce the behavior:

  1. Set your package to version 3.0.0 of actions/github
"dependencies": {
    "@actions/core": "^1.2.4",
    "@actions/github": "^3.0.0",
    "js-yaml": "^3.14.0"
  },
  1. Try and list the Pull Requests in the repo within an action
const myToken = core.getInput('repo-token');
const octokit = github.getOctokit(myToken)
console.log('octokit.pulls.list()');
const { data: pullRequestList } = await octokit.pulls.list({
  ...github.context.repo,
});
console.log('pullRequestList: ' + JSON.stringify(pullRequestList));
  1. Trigger the action to run
  2. Results in Bad Credentials error. From my logs
octokit.pulls.list()
Error: Bad credentials
##[error]Bad credentials

I have tried both the GitHub Token secret and a PAT. Both had the same outcome.

Expected behavior
I would expect this to authenticate and list the PRs as per all documentation I have read indicating this should work.

Additional context
Is this related to what looks to be some significant changes between v2.2.0 and 3.0.0.
I'm going back to v2.2.0 for now as a workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions