All files / Cognigy-CLI release.config.js

0% Statements 0/1
100% Branches 0/0
100% Functions 0/0
0% Lines 0/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                                                                                                                               
module.exports = {
  branches: [
    'main',
    {
      name: 'develop',
      prerelease: true,
    },
  ],
  // Explicitly configure verifyConditions to skip npm verification.
  // Per npm docs: "npm whoami will not reflect OIDC authentication status since
  // the authentication occurs only during the publish operation."
  verifyConditions: [
    '@semantic-release/changelog',
    '@semantic-release/github',
    '@semantic-release/git',
  ],
  plugins: [
    [
      '@semantic-release/commit-analyzer',
      {
        preset: 'angular',
        releaseRules: [
          { type: 'docs', scope: 'README', release: 'patch' },
          { type: 'refactor', release: 'patch' },
          { type: 'style', release: 'patch' },
        ],
      },
    ],
    '@semantic-release/release-notes-generator',
    [
      '@semantic-release/changelog',
      {
        changelogFile: 'CHANGELOG.md',
      },
    ],
    // Use @semantic-release/exec instead of @semantic-release/npm because:
    // 1. @semantic-release/npm runs 'npm whoami' during prepare/publish which fails
    //    with trusted publishing (OIDC auth only works during 'npm publish').
    // 2. npm 11.5.1+ automatically handles OIDC auth and provenance when running
    //    'npm publish' directly — no --provenance flag needed.
    // 3. The actual npm publish runs as a separate workflow step where OIDC env vars
    //    (ACTIONS_ID_TOKEN_REQUEST_URL/TOKEN) are available.
    [
      '@semantic-release/exec',
      {
        prepareCmd:
          'npm version ${nextRelease.version} --no-git-tag-version --allow-same-version',
        // Write the new version to a file so the workflow step can detect it
        publishCmd: 'echo "${nextRelease.version}" > .semantic-release-version',
      },
    ],
    '@semantic-release/github',
    [
      '@semantic-release/git',
      {
        assets: ['CHANGELOG.md', 'package.json', 'package-lock.json'],
        message:
          // eslint-disable-next-line no-template-curly-in-string
          'chore(release): set `package.json` to ${nextRelease.version} [skip ci]',
      },
    ],
  ],
};