semantic-release / gitlab

:fox_face: semantic-release plugin to publish a GitLab release
MIT License
283 stars 78 forks source link

Versionning a NodeJS project using GitLab CI not working in verify conditions section #155

Closed BilelK91 closed 2 years ago

BilelK91 commented 4 years ago

Environment

branches:

    auto_increment:
      stage: auto_increment
      image: https://git.registry/dockerimages/node:13.16.3-stretch-git
      only:
        refs:
        - master
        - alpha
        # This matches maintenance branches
        - /^(([0-9]+)\.)?([0-9]+)\.x/
        # This matches pre-releases
        - /^([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?$/
      script:
      - rm -f package-lock.json
      - npm install semantic-release --save-dev
      - npm install @semantic-release/gitlab 
      - npx semantic-release --debug
[12:42:28 PM] [semantic-release] › ℹ  Running semantic-release version 15.14.0
 2020-07-06T12:42:28.229Z semantic-release:config load config from: /builds/bk/NodejsApp/.releaserc.yml
 2020-07-06T12:42:28.240Z semantic-release:config options values: {
   branch: 'master',
   repositoryUrl: 'https://[secure]@GitLabURI/bk/NodejsApp.git',
   tagFormat: 'v${version}',
   plugins: [
     '@semantic-release/commit-analyzer',
     '@semantic-release/release-notes-generator',
     '@semantic-release/git',
     '@semantic-release/npm',
     '@semantic-release/gitlab'
   ],
   branches: [
     'master',
     '+([0-9])?(.{+([0-9]),x}).x',
     { name: 'alpha', prerelease: 'alpha' }
   ],
   _: [],
   debug: true,
   '$0': 'node_modules/.bin/semantic-release'
 }
 2020-07-06T12:42:28.433Z semantic-release:plugins options for @semantic-release/git/verifyConditions: {}
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
 2020-07-06T12:42:28.435Z semantic-release:plugins options for @semantic-release/npm/verifyConditions: {}
 2020-07-06T12:42:28.436Z semantic-release:plugins options for @semantic-release/gitlab/verifyConditions: {}
 2020-07-06T12:42:28.436Z semantic-release:plugins options for @semantic-release/commit-analyzer/analyzeCommits: {}
 2020-07-06T12:42:28.436Z semantic-release:plugins options for @semantic-release/release-notes-generator/generateNotes: {}
 2020-07-06T12:42:28.437Z semantic-release:plugins options for @semantic-release/git/prepare: {}
 2020-07-06T12:42:28.437Z semantic-release:plugins options for @semantic-release/npm/prepare: {}
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/npm"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/gitlab"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/npm"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/npm"
 [12:42:28 PM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/gitlab"
 2020-07-06T12:42:28.437Z semantic-release:plugins options for @semantic-release/npm/publish: {}
 2020-07-06T12:42:28.438Z semantic-release:plugins options for @semantic-release/gitlab/publish: {}
 [12:42:28 PM] [semantic-release] › ✔  Run automated release from branch master
 [12:42:29 PM] [semantic-release] › ✔  Allowed to push to the Git repository
 [12:42:29 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
 [12:42:29 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"
 [12:42:29 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/npm"
 [12:42:29 PM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/npm"
 [12:42:29 PM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/gitlab"
 [12:42:29 PM] [semantic-release] [@semantic-release/gitlab] › ℹ  Verify GitLab authentication (https://GitLabURI/api/v4)
 2020-07-06T12:42:29.039Z semantic-release:gitlab apiUrl: 'https://GitLabURI/api/v4'
 2020-07-06T12:42:29.039Z semantic-release:gitlab repoId: 'bk/NodejsApp'
 [12:42:29 PM] [semantic-release] › ✖  Failed step "verifyConditions" of plugin "@semantic-release/gitlab"
 [12:42:29 PM] [semantic-release] › ✖  An error occurred while running semantic-release: TypeError: Cannot read property 'statusCode' of undefined
     at module.exports (/builds/bk/NodejsApp/node_modules/@semantic-release/gitlab/lib/verify.js:62:26)
     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
   pluginName: '@semantic-release/gitlab'
 }
 AggregateError: 
     TypeError: Cannot read property 'statusCode' of undefined
         at module.exports (/builds/bk/NodejsApp/node_modules/@semantic-release/gitlab/lib/verify.js:62:26)
     at /builds/bk/NodejsApp/node_modules/semantic-release/lib/plugins/pipeline.js:54:11
     at processTicksAndRejections (internal/process/task_queues.js:97:5)
     at async Object.pluginsConf.<computed> [as verifyConditions] (/builds/bk/NodejsApp/node_modules/semantic-release/lib/plugins/index.js:80:11)
     at async run (/builds/bk/NodejsApp/node_modules/semantic-release/index.js:84:3)
     at async module.exports (/builds/bk/NodejsApp/node_modules/semantic-release/index.js:176:22)
     at async module.exports (/builds/bk/NodejsApp/node_modules/semantic-release/cli.js:55:5)
 ERROR: Job failed: command terminated with exit code 1
yyynnn commented 4 years ago

this could be bypassed with NODE_TLS_REJECT_UNAUTHORIZED = 0 env variable, but..

mokhos commented 4 years ago

Hi there. I have the same problem. What is the solution? What is the cause anyway? Is there any other environment variable than GITLAB_TOKEN needed?

P.S: I have on-premise GitLab!

fgreinacher commented 2 years ago

This looks a bit similar to #139. Is it still happening for you in current Node versions?

fgreinacher commented 2 years ago

Closing this as I assume it is fixed in current Node versions. Feel free to reopen!