Commit 077e9c0a authored by Cédric OLIVIER's avatar Cédric OLIVIER Committed by Olivier Cédric
Browse files

feat: Change boolean variable behaviour



BREAKING CHANGE: boolean variable now triggered on explicit 'true' value

Signed-off-by: default avatarCédric OLIVIER <cedric3.olivier@orange.com>
parent 280ec0bb
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ If no configuration is found, the template will generate one with the following
    * [@semantic-release/release-notes-generator](https://github.com/semantic-release/release-notes-generator)
    * [@semantic-release/gitlab](https://github.com/semantic-release/gitlab)
    * [@semantic-release/git](https://github.com/semantic-release/git)
    * optional [@semantic-release/changelog](https://github.com/semantic-release/changelog) if `SEMREL_CHANGELOG_ENABLED` is set
    * optional [@semantic-release/changelog](https://github.com/semantic-release/changelog) if `SEMREL_CHANGELOG_ENABLED` is set to `true`
    * optional [@semantic-release/exec](https://github.com/semantic-release/exec) if any hook script is found (see [hook scripts](#hook_scripts))
* `branches`: `master`

@@ -52,11 +52,11 @@ As specified in the previous chapter, these variables are only used to generated

| Name                          | description                                            | default value |
| ------------------------------| ------------------------------------------------------ | ------------- |
| `SEMREL_CHANGELOG_ENABLED`    | Add the [@semantic-release/changelog](https://github.com/semantic-release/changelog) plugin which will commit a changelog file in the repository. | _none_ |
| `SEMREL_CHANGELOG_ENABLED`    | Add the [@semantic-release/changelog](https://github.com/semantic-release/changelog) plugin which will commit a changelog file in the repository if set to `true`. | _none_ |
| `SEMREL_CHANGELOG_FILE`    | [changelogFile @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). | _none_ (use the plugin default value which is `CHANGELOG.md`). |
| `SEMREL_CHANGELOG_TITLE`   | [changelogTitle @semantic-release/changelog option](https://github.com/semantic-release/changelog#options). You might want to use markdown format (for example `# MyApp Changelog`). | _none_ |
| `SEMREL_DRY_RUN`              | Activate the [dryRun semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#dryrun) if present. | _none_ |
| `SEMREL_AUTO_RELEASE_ENABLED` | When set the job start automatically. When not set (default), the job is manual. | _none_ |
| `SEMREL_AUTO_RELEASE_ENABLED` | When set to `true` the job start automatically. When not set (default), the job is manual. | _none_ |
| `SEMREL_TAG_FORMAT`           | [tagFormat semantic-release option](https://github.com/semantic-release/semantic-release/blob/master/docs/usage/configuration.md#tagformat). :warning: don't forget to double the `$` character so it is not interpreted by GitLab.                   | `$${version}` |
| `SEMREL_HOOKS_DIR`             | [Hook scripts](#hook_scripts) folder. | `.` |
| `SEMREL_RELEASE_DISABLED`      | Disable this job. | _none_ |
+5 −5
Original line number Diff line number Diff line
@@ -337,7 +337,7 @@ stages:

  # this script console output is inserted in generated file: DO NOT ADD LOGS
  function generate_changelog_plugin_conf() {
    if [[ -n "${SEMREL_CHANGELOG_ENABLED}" ]]; then
    if [[ "${SEMREL_CHANGELOG_ENABLED}" = "true" ]]; then
      if [[ -n "${SEMREL_CHANGELOG_FILE}" ]] || [[ -n "${SEMREL_CHANGELOG_TITLE}" ]]; then
        if [[ -n "${SEMREL_CHANGELOG_FILE}" ]]; then
          changeLogConfig="changelogFile: '${SEMREL_CHANGELOG_FILE}'"
@@ -359,7 +359,7 @@ stages:
  function generate_git_plugin_conf() {
    # git plugin has default changelog file as asset by default so 
    # we need to add it explicitly if the user configured a custom changelogFile
    if [[ -n "${SEMREL_CHANGELOG_ENABLED}" ]] && [[ -n "${SEMREL_CHANGELOG_FILE}" ]]; then
    if [[ "${SEMREL_CHANGELOG_ENABLED}" = "true" ]] && [[ -n "${SEMREL_CHANGELOG_FILE}" ]]; then
      echo "  - - '@semantic-release/git'"
      echo "    - assets:"
      echo "      - '${SEMREL_CHANGELOG_FILE}'"
@@ -518,7 +518,7 @@ stages:
    fi
  }

  if [[ -z "$TEMPLATE_CHECK_UPDATE_DISABLED" ]]; then check_for_update semrel "1.2.0"; fi
  if [[ "$TEMPLATE_CHECK_UPDATE_DISABLED" != "true" ]]; then check_for_update semrel "1.2.0"; fi
  unscope_variables
  eval_all_secrets

@@ -559,10 +559,10 @@ semantic-release:
    - prepare_semantic_release
    - semantic-release --ci ${SEMREL_DRY_RUN+-d}
  rules:
    - if: $SEMREL_RELEASE_DISABLED
    - if: '$SEMREL_RELEASE_DISABLED == "true"'
      when: never
    # on production branch(es): auto if SEMREL_AUTO_RELEASE_ENABLED
    - if: '$SEMREL_AUTO_RELEASE_ENABLED && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    - if: '$SEMREL_AUTO_RELEASE_ENABLED == "true" && $CI_COMMIT_REF_NAME =~ $PROD_REF'
    # on production branch(es): manual by default
    - if: '$CI_COMMIT_REF_NAME =~ $PROD_REF'
      when: manual