failCmd doesn't get invoked when publishCmd returns non-zero error code

Open
#335 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, shell
Domain
cli, release

Research direction

Reproduce the workflow using the shown publishCmd, failCmd, successCmd, and verifyConditionsCmd configuration, then inspect the semantic-release/exec handling around publishCmd errors. Compare the observed error log with the expected failure notification behavior; done means failCmd is invoked when publishCmd exits non-zero without the release crashing first.

Written by the indexing model from the issue text.

Description

semantic-release-errorlog.log
I'm trying to create a workflow where I should be able to notify on success and failure of publishCmd, but failCmd doesn't get invoked at all when publishCmd returns non-zero error code. Instead the semantic-release crashes with error stack trace.

{
  "ci": false,
  "branches": [
    "test",
    {
      "name": "beta",
      "prerelease": true
    },
    {
      "name": "alpha",
      "prerelease": true
    }
  ],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "@semantic-release/changelog",
      {
        "changelogFile": "docs/CHANGELOG.md"
      }
    ],
    [
      "@semantic-release/exec",
      {
        "failCmd": "./fail.py",
        "successCmd": "./success.py",
        "publishCmd": "./deploy.sh \"${nextRelease.version}\"",
        "verifyConditionsCmd": "./verify.py"
      }
    ],
    [
      "@semantic-release/git",
      {
        "assets": [
          "docs/CHANGELOG.md"
        ],
        "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
      }
    ]
  ]
}
Dominant language
JavaScript
Stars
164
Forks
28
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from semantic-release/exec

All issues in semantic-release/exec

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.