I have a public orb.
In the config.yml file i set fail-if-semver-not-indicated parameter to true but even when not supplying with semver in the commit the build passes.
When looking at the job run i can even see that semver was not detected:
Commit subject: change readme. Commit subject did not indicate which SemVer increment to make. To publish orb, you can ammend the commit or push another commit with [semver:FOO] in the subject where FOO is major, minor, patch. Note: To indicate intention to skip promotion, include [semver:skip] in the commit subject instead.
CircleCI received exit code 0
This is the relevant config part:
integration-test_deploy:
when: << pipeline.parameters.run-integration-tests >>
jobs:
- orb-tools/dev-promote-prod-from-commit-subject:
orb-name: ridehip/hip-orb
context: orb-publishing
add-pr-comment: false
fail-if-semver-not-indicated: true
publish-version-tag: false
filters:
branches:
only:
- main
I suspect the issue stems from the expression [ "$SHOULD_FAIL" == "true" ] being tested in this part of the orb’s code:
CheckIncrement() {
if [ -z "${SEMVER_INCREMENT}" ];then
echo "Commit subject did not indicate which SemVer increment to make."
echo "To publish orb, you can ammend the commit or push another commit with [semver:FOO] in the subject where FOO is major, minor, patch."
echo "Note: To indicate intention to skip promotion, include [semver:skip] in the commit subject instead."
if [ "$SHOULD_FAIL" == "true" ];then
exit 1
else
echo "export PR_MESSAGE=\"BotComment: Orb publish was skipped due to [semver:patch|minor|major] not being included in commit message.\"" >> "$BASH_ENV"
fi
elif [ "$SEMVER_INCREMENT" == "skip" ];then
echo "SEMVER in commit indicated to skip orb release"
echo "export PR_MESSAGE=\"BotComment: Orb publish was skipped due to [semver:skip] in commit message.\"" >> "$BASH_ENV"
else
PublishOrb
echo "export PR_MESSAGE=\"BotComment: *Production* version of orb available for use - \\\`${ORB_VERSION}\\\`\"" >> "$BASH_ENV"
fi
}
SHOULD_FAIL is defined as an environment variable of the related step:
However, though fail-if-semver-not-indicated will either be true or false, the SHOULD_FAIL shell variable will only ever resolve to 1 or 0, so "$SHOULD_FAIL" == "true" will never happen, hence fail-if-semver-not-indicated's value not being honored.