un-ts / changesets-gitlab

GitLab CI cli for changesets like its GitHub Action.
https://opencollective.com/unts/projects/changesets-gitlab
MIT License
86 stars 33 forks source link

Error: when SSH Port different from 22 #175

Open federi95 opened 5 months ago

federi95 commented 5 months ago

Hi I'm trying to release my monorepo library using changesets-gitlab, comment stage goes well, but when it comes to release stage it results into an error. I'm trying to debug this issue since in the .git/config I have

pushurl = git@HOST:PORT/REPO.git

where HOST is not gitlab, PORT is not 22 and REPO is ofc the repo

after pnpm changesets-gitlab command I got this:

[command]/usr/bin/git push origin HEAD:changeset-release/master --force
ssh: connect to host HOST port 22: Connection refused
fatal: Could not read from remote repository.

This happen here, run.ts:292

await gitUtils.push(versionBranch, { force: true })

This is the ci yaml

stages:
  - comment
  - release

before_script:
  - corepack enable
  - corepack prepare pnpm@latest --activate
  - pnpm i --no-frozen-lockfile

comment:
  image: node:lts-alpine
  stage: comment
  only:
    - merge_requests
  script: pnpm changesets-gitlab comment
  variables:
    GITLAB_TOKEN: '${GITLAB_TOKEN}'

release:
  image: node:lts-alpine
  stage: release
  only:
    - master
  script:
    - apk --no-cache add git openssh
    - cat .git/config
    - pnpm changesets-gitlab
  variables:
    INPUT_ONLY_CHANGESETS: 'true'
    INPUT_REMOVE_SOURCE_BRANCH: 'true'
    INPUT_CREATE_GITLAB_RELEASES: 'false'
    GITLAB_TOKEN: '${GITLAB_TOKEN}'
    INPUT_PUBLISH: pnpm build && pnpm run publish