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

[semver:patch] Ensure fail-if-semver-not-indicated parameter set to true is honored #113

Merged
merged 1 commit into from
May 25, 2021

Conversation

yaningo
Copy link
Contributor

@yaningo yaningo commented May 24, 2021

Checklist

  • [n/a] All new jobs, commands, executors, parameters have descriptions
  • [n/a] Examples have been added for any significant new features
  • [n/a] README has been updated, if necessary

Motivation, issues

In the dev-promote-from-commit-subject command's definition, the function CheckIncrement relies on a conditional expression to decide whether or no to fail the build if the commit subject doesn't include a SemVer increment:

if [ "$SHOULD_FAIL" == "true" ];then
  exit 1

SHOULD_FAIL is defined as an environment variable of the related step:

SHOULD_FAIL: <<parameters.fail-if-semver-not-indicated>>

However, as the shell environment variable SHOULD_FAIL will only ever resolves to either:

  • 1 (if fail-if-semver-not-indicated is set to true)

or

  • 0 (if fail-if-semver-not-indicated is set to false)

the expression [ "$SHOULD_FAIL" == "true" ] will always return false, and therefore the fail-if-semver-not-indicated parameter set to true will never be honored.

Description

Modify the aforementioned conditional expression so it references the relevant value of the environment variable, and allows fail-if-semver-not-indicated set to true to be honored.

Fixes #112

@yaningo yaningo requested a review from a team as a code owner May 24, 2021 23:41
@yaningo yaningo changed the title Ensure fail-if-semver-not-indicated parameter set to true is honored [semver:patch] Ensure fail-if-semver-not-indicated parameter set to true is honored May 24, 2021
@gmemstr gmemstr merged commit 6a6307a into CircleCI-Public:master May 25, 2021
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

Successfully merging this pull request may close these issues.

Parameter fail-if-semver-not-indicated set to true is ignored
2 participants