From 396c54cecf287d1663d762afd4992ad5a325c78c Mon Sep 17 00:00:00 2001 From: Bastian Fredriksson Date: Mon, 4 Dec 2023 18:48:59 +0100 Subject: [PATCH] docs: commitlint with jx3 Give an example (step template) of how to use commitlint with Jenkins X. --- docs/guides-ci-setup.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/guides-ci-setup.md b/docs/guides-ci-setup.md index 8325e7b613..d98cbe1530 100644 --- a/docs/guides-ci-setup.md +++ b/docs/guides-ci-setup.md @@ -145,6 +145,29 @@ lint:commit: - echo "${CI_COMMIT_MESSAGE}" | commitlint ``` +## Jenkins X + +``` +apiVersion: tekton.dev/v1beta1 +kind: PipelineRun +metadata: + name: pullrequest +spec: + pipelineSpec: + tasks: + - name: conventional-commits + taskSpec: + steps: + - name: lint-commit-messages + image: commitlint/commitlint + script: | + #!/usr/bin/env sh + . .jx/variables.sh + commitlint --extends '@commitlint/config-conventional' --from $PR_BASE_SHA --to $PR_HEAD_SHA + serviceAccountName: tekton-bot + timeout: 15m +``` + ### 3rd party integrations #### [Codemagic](https://codemagic.io/)