semantic-release / semantic-release/github

Plugin fails to load with ssh error: "Permission denied (publickey)"

Open
#674 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
534
Forks
150
Avg merge
1m
Merged PRs (30d)
3

Description

I'm configuring semantic-release in a repo, but I get the error. Plugin fails to load.

GITHUB_TOKEN is definitely passed, other plugins work correctly.

Error:

[4:00:32 PM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
...
...
2023-07-30T16:00:32.331Z semantic-release:get-git-auth-url Verifying ssh auth by attempting to push to  git@github.com:SylvanasCry/schema-registry-ajv.git
2023-07-30T16:00:32.421Z semantic-release:git Error: Command failed with exit code 128: git push --dry-run --no-verify git@github.com:SylvanasCry/schema-registry-ajv.git HEAD:master
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
    at makeError (file:///home/runner/work/schema-registry-ajv/schema-registry-ajv/node_modules/semantic-release/node_modules/execa/lib/error.js:60:11)

release.yml

name: Release
on:
  push:
    branches:
      - master

permissions:
  contents: read # for checkout

jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    permissions:
      contents: write # to be able to publish a GitHub release
      issues: write # to be able to comment on released issues
      pull-requests: write # to be able to comment on released pull requests
      id-token: write # to enable use of OIDC for npm provenance
    steps:
      # ...
      # ...
      # ...
      - name: Release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        run: npm run semantic-release

package.json

  "release": {
    "branches": [
      "master"
    ],
    "plugins": [
      "@semantic-release/commit-analyzer",
      "@semantic-release/release-notes-generator",
      [
        "@semantic-release/github",
        {
          "assets": [
            { "path": "dist/index.js", "label": "Module" },
            { "path": "README.md", "label": "Documentation" },
            { "path": "CHANGELOG.md", "label": "Documentation" },
            { "path": "LICENSE", "label": "License" }
          ]
        }
      ],
      "@semantic-release/npm",
      [
        "@semantic-release/changelog",
        {
          "changelogFile": "CHANGELOG.md"
        }
      ],
      [
        "@semantic-release/git",
        {
          "assets": ["package.json", "CHANGELOG.md"],
          "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
        }
      ]
    ]
  },

image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the release.yml workflow and package.json semantic-release configuration, then trace how the configured GitHub and Git plugins reach semantic-release's get-git-auth-url check. Reproduce the workflow and compare the documented token and repository authentication path with the failing dry-run; done means the release job loads its plugins without the SSH permission error.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, github-actions, javascript
Domain
ci-cd, release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.