Skip to content
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

RangeError: Invalid time value #3292

Closed
XavierJ96 opened this issue May 7, 2024 · 7 comments
Closed

RangeError: Invalid time value #3292

XavierJ96 opened this issue May 7, 2024 · 7 comments

Comments

@XavierJ96
Copy link

XavierJ96 commented May 7, 2024

Current behavior

I am experiencing problems when I attempt to execute my workflow to create the release.

release.yml

name: Release

on:
  workflow_dispatch:

jobs:
  release:
    permissions:
      contents: write
      issues: write
      pull-requests: write
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: '21.1.0'
      - run: npm ci
      - run: npx semantic-release
        env:
          GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}

Expected behavior

To work and create the release.

semantic-release version

23.0.8

CI environment

Github Actions

Plugins used

 "@semantic-release/changelog": "^6.0.3",
 "@semantic-release/commit-analyzer": "^12.0.0",
 "@semantic-release/release-notes-generator": "^13.0.0"
 "@semantic-release/git": "^10.0.1",
 "@semantic-release/github": "^10.0.3",
 "conventional-changelog-conventionalcommits": "^8.0.0",
 "semantic-release": "^23.0.8"

semantic-release configuration

const config = {
  branches: ["main"],
  plugins: [
    [
      "@semantic-release/commit-analyzer",
      {
        preset: "angular",
        releaseRules: [
          {
            breaking: true,
            release: "major",
          },
          {
            type: "feat",
            release: "minor",
          },
          {
            type: "fix",
            release: "patch",
          },
          {
            type: "docs",
            scope: "README",
            release: "patch",
          },
          {
            type: "chore",
            release: "patch",
          },
        ],
        parserOpts: {
          noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"],
        },
      },
    ],
    [
      "@semantic-release/release-notes-generator",
      {
        preset: "conventionalcommits",
        presetConfig: {
          types: [
            { type: "feat", section: "Features", hidden: false },
            { type: "fix", section: "Bug Fixes", hidden: false },
            { type: "docs", section: "Miscellaneous Chores", hidden: false },
            { type: "chore", section: "Miscellaneous Chores", hidden: false },
          ],
        },
        parserOpts: {
          noteKeywords: ["BREAKING CHANGE", "BREAKING CHANGES", "BREAKING"],
        },
      },
    ],
    [
      "@semantic-release/changelog",
      {
        changelogFile: "CHANGELOG.md",
      },
    ],
    [
      "@semantic-release/git",
      {
        assets: ["package.json", "CHANGELOG.md"],
      },
    ],
    "@semantic-release/github",
  ],
};

module.exports = config;

CI logs

chore: update config
[10:11:42 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The commit should not trigger a release
[10:11:42 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analyzing commit: chore: update config
[10:11:42 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  The release type for the commit is patch
[10:11:42 AM] [semantic-release] [@semantic-release/commit-analyzer] › ℹ  Analysis of 6 commits complete: patch release
[10:11:42 AM] [semantic-release] › ✔  Completed step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
[10:11:42 AM] [semantic-release] › ℹ  The next release version is 1.0.21
[10:11:42 AM] [semantic-release] › ℹ  Start step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[10:11:42 AM] [semantic-release] › ✘  Failed step "generateNotes" of plugin "@semantic-release/release-notes-generator"
[10:11:42 AM] [semantic-release] › ✘  An error occurred while running semantic-release: RangeError: Invalid time value
    at committerDate (/home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/index.js:80:30)
    at /home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/lib/util.js:202:17
    at Array.forEach (<anonymous>)
    at processCommit (/home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/lib/util.js:198:31)
    at /home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/index.js:123:32 {
  pluginName: '@semantic-release/release-notes-generator'
}
RangeError: Invalid time value
    at committerDate (/home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/index.js:80:30)
    at /home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/lib/util.js:202:17
    at Array.forEach (<anonymous>)
    at processCommit (/home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/lib/util.js:198:31)
    at /home/runner/work/CI-CD-Test/CI-CD-Test/node_modules/conventional-changelog-writer/index.js:123:32 {
  pluginName: '@semantic-release/release-notes-generator'
}
Error: Process completed with exit code [1](https://github.com/XavierJ96/CI-CD-Test/actions/runs/8983555274/job/24673577456#step:10:1).
@sushant-dev01
Copy link

Saw same problem today

@Shahroz16
Copy link

Facing the same issue.

@XavierJ96
Copy link
Author

@Shahroz16 , @sushant-dev01 ,

I've just noticed that there is another issue open on a different repository @Here

@XavierJ96
Copy link
Author

Looks like semantic-release uses an old version of conventional-changelog-conventionalcommits.

For now, the workaround for me was installing the previous version of conventional-changelog-conventionalcommits.

 npm install --save-dev conventional-changelog-conventionalcommits@7.0.2     

@sushant-dev01
Copy link

Hey semantic-release team, could you let us know when you plan to address it? Thanks!

@travi
Copy link
Member

travi commented May 7, 2024

The new versions of the conventional changelog plugins were released with breaking changes only days ago. We will upgrade when we have time, but we have not introduced the problems you are seeing by not updating.

We recommend you always pin at least to the major version of the packages you are installing alongside semantic-release. The only reason you are needing to "downgrade" is because you are installing latest, which is resulting in you updating to the latest major version immediately (before we have updated to account for the breaking changes).

@travi
Copy link
Member

travi commented May 7, 2024

Closing in favor of semantic-release/release-notes-generator#633

@travi travi closed this as not planned Won't fix, can't repro, duplicate, stale May 7, 2024
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