Skip to content
Snippets Groups Projects
Commit 612dc3ea authored by Daniel Dehennin's avatar Daniel Dehennin
Browse files

feat(commitlint): users can configure the base branch

Users can override the variable `BASE_BRANCH` in their
`.gitlab-ci.yml` to select the starting point of the logs to
validate.
parent bc7f19c3
No related branches found
No related tags found
No related merge requests found
......@@ -7,10 +7,11 @@ commitlint:
image: "$COMMITLINT_IMAGE"
variables:
COMMITLINT_IMAGE: 'hub.eole.education/eole/commitlint:latest'
BASE_BRANCH: "${CI_DEFAULT_BRANCH}"
script:
- 'git fetch --all'
# Set default commit hashes for `--from` and `--to`
- 'export COMMITLINT_FROM="$(git merge-base origin/${CI_DEFAULT_BRANCH} HEAD)"'
- 'export COMMITLINT_FROM="$(git merge-base origin/${BASE_BRANCH} HEAD)"'
- 'export COMMITLINT_TO="${CI_COMMIT_SHA}"'
# Run `commitlint`
- 'commitlint --from "${COMMITLINT_FROM}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment