Skip to content

GitHub default url should be api.github.com #271

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

Closed
lholota opened this issue May 15, 2020 · 6 comments
Closed

GitHub default url should be api.github.com #271

lholota opened this issue May 15, 2020 · 6 comments

Comments

@lholota
Copy link

lholota commented May 15, 2020

Hi, I am using the semantic-release/github in a couple of my repositories it started throwing the following error lately:

[10:08:30 AM] [semantic-release] › ✖  An error occurred while running semantic-release: RequestError [HttpError]: Cookies must be enabled to use GitHub.
    at /action/node_modules/@octokit/request/dist-node/index.js:66:23
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  status: 403,
...

Based on my investigation, this is caused by passing incorrect url to Octokit (i.e. https://github.com instead of https://api.github.com) as mentioned in this issue in Octokit.

As it seems, the default url is github.com. Mitigation is possible using the GH_URL or GITHUB_URL environment variables. But given that this is the default value which might be used by many people, I think this should be updated.

Logs can be found in one my repo's CI/CD run

@gr2m
Copy link
Member

gr2m commented May 17, 2020

This was fixed by #269, make sure to update your lock file so you get the latest version.

@Silthus
Copy link

Silthus commented May 22, 2020

I have the same error and already updated to 7.0.6. I also cannot get it to work with the GITHUB_API_URL environment variable. No matter what I do, the release fails.

Also one other strange thing I noticed: when the release fails it does not open an issue on Github, but creates a tag and publishes a package. This makes the release half broken and every time the action fails I need to bump the version. Is this intended or am I doing something wrong?

https://github.com/Silthus/sLib/runs/699757716?check_suite_focus=true#step:8:73

[1:36:29 PM] [semantic-release] › ✖  An error occurred while running semantic-release: RequestError [HttpError]: Cookies must be enabled to use GitHub.
    at /home/runner/work/sLib/sLib/node_modules/@octokit/request/dist-node/index.js:66:23
    at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  status: 403,

package.json

{
  "devDependencies": {
    "@semantic-release/changelog": "5.0.1",
    "@semantic-release/commit-analyzer": "8.0.1",
    "@semantic-release/git": "9.0.0",
    "@semantic-release/github": "7.0.6",
    "@semantic-release/release-notes-generator": "9.0.1",
    "commitlint": "8.3.5",
    "conventional-changelog-conventionalcommits": "4.3.0",
    "gradle-semantic-release-plugin": "1.4.1",
    "husky": "4.2.5",
    "lint-staged": "10.2.6",
    "prettier": "2.0.5",
    "semantic-release": "17.0.7"
  },
  "scripts": {
    "semantic-release": "npx semantic-release"
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
    }
  },
  "lint-staged": {
    "*.{md,json}": [
      "prettier --write",
      "git add"
    ],
    "*.{gradle,java}": [
      "git add"
    ]
  },
  "release": {
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      "@semantic-release/changelog",
      "gradle-semantic-release-plugin",
      [
        "@semantic-release/github",
        {
          "assets": [
            {
              "path": "**/build/libs/*.jar"
            }
          ]
        }
      ],
      [
        "@semantic-release/git",
        {
          "assets": [
            "gradle.properties",
            "CHANGELOG.md"
          ]
        }
      ]
    ]
  },
  "engines": {
    "node": ">=12.14"
  }
}

@gr2m
Copy link
Member

gr2m commented May 22, 2020

I think it only creates an issue if the verify step failed, which it didn't in this case.

I'm not sure why it still gets the config wrong, but it definitely sends the request to https://github.com instead of https://api.github.com:
https://github.com/Silthus/sLib/runs/699757716?check_suite_focus=true#step:8:99

@Silthus
Copy link

Silthus commented May 23, 2020

Any idea what I can do about the failing releases?

The strange think is that I have another repository using the exact same build process and that works: https://github.com/Silthus/spigot-plugin-template

@gr2m
Copy link
Member

gr2m commented May 24, 2020

I don't know what the problem could be and I can't investigate further I'm afraid. My first guess woudl be that somehow you still have an outdated semantic-release version running somewhere ... In the build that failed, you are using a semantic-release action: https://github.com/homecentr/docker-base/actions/runs/105566028/workflow#L16-L19, maybe try to use run: npx semantic-release instead

@babblebey
Copy link
Member

babblebey commented Jul 24, 2024

Addressed in #269

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