From dc5b866d873e0be77049946c4c3286b057624a4b Mon Sep 17 00:00:00 2001 From: Jordan Petridis Date: Thu, 4 Jan 2024 14:35:45 +0200 Subject: [PATCH] ci: Run the commit lint job as a user Part of #2433 Part-of: --- .gitlab-ci.yml | 7 +++++-- .gitlab-image-tags.yml | 2 +- ci/docker/lint/prepare.sh | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 211c78f83e..afb4f94a72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,9 +1,9 @@ include: - project: 'freedesktop/ci-templates' - ref: 185ede0e9b9b1924b92306ab8b882a6294e92613 + ref: "801093be0b88f23c8dbabe9cfce7134548f7ccdc" file: '/templates/fedora.yml' - project: 'freedesktop/ci-templates' - ref: 185ede0e9b9b1924b92306ab8b882a6294e92613 + ref: "801093be0b88f23c8dbabe9cfce7134548f7ccdc" file: '/templates/debian.yml' ### # IMPORTANT @@ -161,6 +161,7 @@ gst-indent amd64 docker: FDO_DISTRIBUTION_TAG: "$LINT_TAG-$GST_UPSTREAM_BRANCH" FDO_DISTRIBUTION_PACKAGES: 'python3-pip git' FDO_DISTRIBUTION_EXEC: 'ci/docker/lint/prepare.sh' + FDO_USER: "ciuser" commitlint docker: extends: @@ -242,6 +243,8 @@ commitlint: needs: - job: 'commitlint docker' artifacts: false + before_script: + - git config --global --add safe.directory $CI_PROJECT_DIR script: - echo $CI_MERGE_REQUEST_DIFF_BASE_SHA - gitlint --commits $CI_MERGE_REQUEST_DIFF_BASE_SHA..HEAD diff --git a/.gitlab-image-tags.yml b/.gitlab-image-tags.yml index 190ee15cb0..cb8d2ba16d 100644 --- a/.gitlab-image-tags.yml +++ b/.gitlab-image-tags.yml @@ -9,6 +9,6 @@ variables: INDENT_TAG: '2023-08-24.3' - LINT_TAG: '2023-02-16.5' + LINT_TAG: '2024-02-20.0' WINDOWS_TAG: '2024-02-08.0' diff --git a/ci/docker/lint/prepare.sh b/ci/docker/lint/prepare.sh index 439d81706d..7fa1d94447 100755 --- a/ci/docker/lint/prepare.sh +++ b/ci/docker/lint/prepare.sh @@ -1,3 +1,5 @@ +#! /bin/bash + set -eux python3 -m pip install gitlint