semantic-release-action icon indicating copy to clipboard operation
semantic-release-action copied to clipboard

Semantic release fails with git plugin

Open lethalbrains opened this issue 3 years ago • 3 comments

Describe the bug Semantic release was working perfectly but started failing since this morning. There hasn't been any changes done to the code

**release.config.js **

module.exports = {
    branches: [
        {name: 'main'}, 
		{name: 'beta', prerelease: true}
    ],
	plugins: [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        "@semantic-release/git",
        "@semantic-release/github",
		[
			'@semantic-release/npm',
			{
				npmPublish: false
			}
		]
	]
};

action.yml

name: Deployment

on:
  push:
    branches:
      - main
      - beta

    tags:
      - v*

  pull_request:

jobs:

  build-release: 
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
      - name: Semantic Release
        id: semantic
        uses: cycjimmy/semantic-release-action@v2
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expected behavior An update in the version with every git push.

Current behavior Error

Additional context The issue is occurs only when I add @semantic-release/git to the release.config.js. When its removed, everything works as expected.

lethalbrains avatar Jul 17 '21 01:07 lethalbrains

@semantic-release/git is not in the default list of plugins of semantic release and it must be added to extra_plugins in your actions file.

See extra_plugins.

cycjimmy avatar Jul 19 '21 02:07 cycjimmy

@cycjimmy , You are right. But I have had the git plugin in both extra plugin and in release_config.js. Now I just tested it and action works fine even if I have git plugin in release_config.js but on the day I raised the issue, actions threw an error. May be something to do with the environment since it was able to pull the plugin.

Going by your statement, I am not sure why it is working now since I have the git plugin in release_config.js

lethalbrains avatar Jul 19 '21 23:07 lethalbrains

Maybe the dependent packages are still cached. No matter what, if you use @semantic-release/git, add it to extra_plugins.

cycjimmy avatar Jul 20 '21 02:07 cycjimmy