Commit ac3f3c30 authored by Pierre Smeyers's avatar Pierre Smeyers
Browse files

feat: add custom Git user name and email support

parent d809fa5e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -59,6 +59,8 @@ It uses the following variable:
| :lock: `GITOPS_TRIGGER_ONINTEG`   | The GitOps changes to trigger on the integration branch (JSON) - [see below](#triggers-definition-json)   | _none_ (disabled) |
| :lock: `GITOPS_TRIGGER_ONDEV`     | The GitOps changes to trigger on the development branches (JSON) - [see below](#triggers-definition-json) | _none_ (disabled) |
| :lock: `GITOPS_TRIGGER_ONRELEASE` | The GitOps changes to trigger on release tags (JSON) - [see below](#triggers-definition-json)             | _none_ (disabled) |
| :lock: `GIT_USER_NAME`            | Git user name to use when committing                                                                      | `$GITLAB_USER_NAME` |
| :lock: `GIT_USER_EMAIL`           | Git user email to use when committing (global TBC variable)                                               | `$GITLAB_USER_EMAIL` |

### Triggers definition (JSON)

@@ -122,7 +124,6 @@ The triggers definition is formatted as follows:
}
```


> [!important] Late variable expansion mechanism
>
> The template supports a **late variable expansion mechanism** for the `commit_message` and `yq_eval` JSON fields.
+2 −2
Original line number Diff line number Diff line
@@ -423,8 +423,8 @@ gitops-trigger:
    - maybe_install_packages yq git
    # required to allow Git operations while not owner
    - git config --global --add safe.directory $CI_PROJECT_DIR
    - git config --global user.email "$GITLAB_USER_EMAIL"
    - git config --global user.name "$GITLAB_USER_LOGIN"
    - git config --global user.email "${GIT_USER_EMAIL:-$GITLAB_USER_EMAIL}"
    - git config --global user.name "${GIT_USER_NAME:-$GITLAB_USER_NAME}"
    - |
      function trigger_exec() {
        trigger="$1"