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

Incompatibility with semantic-release >v20 #168

Closed
carlobernardini opened this issue Jun 21, 2023 · 13 comments · Fixed by #171
Closed

Incompatibility with semantic-release >v20 #168

carlobernardini opened this issue Jun 21, 2023 · 13 comments · Fixed by #171

Comments

@carlobernardini
Copy link

Describe the bug
Semantic release only supports esm as of v20. This action, however, still imports semantic-release using cjs. As a consequence, it cannot use the latest major versions that are esm-only.

Workflow
For example:

   - name: Semantic Release
        uses: cycjimmy/semantic-release-action@v3
        with:
          semantic_version: 21
          extra_plugins: [email protected]
        env:
          SLACK_WEBHOOK: ***
          GH_TOKEN: ***
          NPM_TOKEN: ***

Additional context
The resulting error in the CI output:

Error: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/index.js from /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/src/index.js not supported.
Instead change the require of /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/node_modules/semantic-release/index.js in /home/runner/work/_actions/cycjimmy/semantic-release-action/v3/src/index.js to a dynamic import() which is available in all CommonJS modules.
@shakefu
Copy link

shakefu commented Jul 31, 2023

Any chance this will be fixed? Otherwise we'll need to migrate away from this action... (Also thank you for your work and OSS contributions!) /cc @cycjimmy

@MikeMcC399
Copy link
Contributor

See:

GitHub prerequisite:

@enell
Copy link
Contributor

enell commented Aug 15, 2023

Node20 is being rolled out. In created a pr for testing it

actions/runner#2619 (comment)

@erzz
Copy link

erzz commented Aug 29, 2023

As of the last few days releases are silently failing on the commit analyzer and this seems to tie in with the work that plugin is doing in supporting the ESM stuff in the last few days.

This feels a bit urgent now! Unfortunately there doesnt seem to be a way via the action of pinning the preinstalled plugins back to previous versions either

e.g.

extra_plugins: |
    @semantic-release/[email protected]

fails (and as the action is using --silent i cant see the exact error)

@dmitrii-didenko
Copy link

@erzz all of my workflows are ending on the following string:
Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"
and it doesn't go any further. Do you see the same on your side?

@BrendanGalloway
Copy link

@dmitrii-didenko Try:

      - uses: cycjimmy/semantic-release-action@v3
        with:
          semantic_version: 19.0.5
          extra_plugins: |
            @semantic-release/[email protected]
            @semantic-release/[email protected]
            @semantic-release/[email protected]
            @semantic-release/[email protected]
            @semantic-release/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Those version are working for us

@erzz
Copy link

erzz commented Aug 29, 2023

@erzz all of my workflows are ending on the following string: Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer" and it doesn't go any further. Do you see the same on your side?

Correct.

@dmitrii-didenko Try:

      - uses: cycjimmy/semantic-release-action@v3
        with:
          semantic_version: 19.0.5
          extra_plugins: |
            @semantic-release/[email protected]
            @semantic-release/[email protected]
            @semantic-release/[email protected]
            @semantic-release/[email protected]
            @semantic-release/[email protected]
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Those version are working for us

Just tried that and same result unfortunately

- name: Semantic Release
  id: semantic-release
  uses: cycjimmy/semantic-release-action@v3
   env:
      GITHUB_TOKEN: ${{ secrets.token }}
    with:
      semantic_version: v19.0.5
      branches: ${{ inputs.branches }}
      dry_run: ${{ inputs.dry-run }}
      extra_plugins: |
        @semantic-release/[email protected]
        @semantic-release/[email protected]
        @semantic-release/[email protected]
        @semantic-release/[email protected]
        @semantic-release/[email protected]
        @semantic-release/changelog
        conventional-changelog-conventionalcommits
        @semantic-release/exec
[11:49:00 AM] [semantic-release] › ℹ  Running semantic-release version 19.0.5
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/changelog"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/github"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "verifyConditions" from "@semantic-release/git"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "analyzeCommits" from "@semantic-release/commit-analyzer"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "generateNotes" from "@semantic-release/release-notes-generator"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/changelog"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "prepare" from "@semantic-release/git"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "publish" from "@semantic-release/github"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "addChannel" from "@semantic-release/github"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "success" from "@semantic-release/github"
[11:49:01 AM] [semantic-release] › ✔  Loaded plugin "fail" from "@semantic-release/github"
[11:49:04 AM] [semantic-release] › ⚠  Run automated release from branch rel-test on repository https://github.com/my-org/my-repo in dry-run mode
[11:49:04 AM] [semantic-release] › ✔  Allowed to push to the Git repository
[11:49:04 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/changelog"
[11:49:04 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/changelog"
[11:49:04 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/github"
[11:49:04 AM] [semantic-release] [@semantic-release/github] › ℹ  Verify GitHub authentication (https://api.github.com/)
[11:49:04 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/github"
[11:49:04 AM] [semantic-release] › ℹ  Start step "verifyConditions" of plugin "@semantic-release/git"
[11:49:04 AM] [semantic-release] › ✔  Completed step "verifyConditions" of plugin "@semantic-release/git"
[11:49:04 AM] [semantic-release] › ℹ  Found git tag v2.2.0 associated with version 2.2.0 on branch rel-test
[11:49:04 AM] [semantic-release] › ℹ  Found 9 commits since last release
[11:49:04 AM] [semantic-release] › ℹ  Start step "analyzeCommits" of plugin "@semantic-release/commit-analyzer"

@BrendanGalloway
Copy link

@erzz for conventional-changelog-conventionalcommits try [email protected]. You will likely need to pin @semantic-release/changelog and @semantic-release/exec to older versions too

@dmitrii-didenko
Copy link

@BrendanGalloway it works. you've saved my day. Thank you!

@erzz
Copy link

erzz commented Aug 29, 2023

Wow @BrendanGalloway - what a ⭐ you are :)

Yes the final tweak of [email protected] got it working again

Huge thankyou for taking the time to help! Seems like the whole ecosystem is a bit of mess at the moment and I would likely never have got to that particular combination of experimentation!

We have a lot of teams using this workflow and were going to need to resort to manual releases until it shook out - Really appreciate it! 🙏🏻

@github-actions
Copy link

🎉 This issue has been resolved in version 4.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@cycjimmy
Copy link
Owner

The latest v4 version already uses the node20 container and supports the latest version of semantic-release.

@MAN-Sendance
Copy link

Indeed [email protected] makes it work again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants