Select Git revision
parse_commit_message.sh
-
This patch introduces a `.gitlab-ci` file along with a `ci/` folder, defininga basic test pipeline triggered by code pushes to a GitLab-CI instance. This initial version includes static checks (checkpatch and smatch for now) and build tests across various architectures and configurations. It leverages an integrated cache for efficient build times and introduces a flexible 'scenarios' mechanism for subsystem-specific extensions. [ci: add prerequisites to run check-patch on MRs] Co-developed-by:
Tales Aparecida <tales.aparecida@redhat.com> Signed-off-by:
Tales Aparecida <tales.aparecida@redhat.com> Signed-off-by:
Helen Koike <helen.koike@collabora.com>
This patch introduces a `.gitlab-ci` file along with a `ci/` folder, defininga basic test pipeline triggered by code pushes to a GitLab-CI instance. This initial version includes static checks (checkpatch and smatch for now) and build tests across various architectures and configurations. It leverages an integrated cache for efficient build times and introduces a flexible 'scenarios' mechanism for subsystem-specific extensions. [ci: add prerequisites to run check-patch on MRs] Co-developed-by:
Tales Aparecida <tales.aparecida@redhat.com> Signed-off-by:
Tales Aparecida <tales.aparecida@redhat.com> Signed-off-by:
Helen Koike <helen.koike@collabora.com>
parse_commit_message.sh 692 B
#!/bin/bash
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2024 Collabora, Helen Koike <helen.koike@collabora.com>
set -exo pipefail
# Get the last commit message
commit_message=$(git log -1 --pretty=%B)
# Define a regex pattern to match KCI_VARIABLE=value
pattern="(KCI_[A-Za-z_]+)=([A-Za-z0-9_-]+)"
# Check if the commit message contains the pattern
if [[ $commit_message =~ $pattern ]]; then
variable_name="${BASH_REMATCH[1]}"
variable_value="${BASH_REMATCH[2]}"
# Export the variable
export "$variable_name=$variable_value"
echo "Exported $variable_name=$variable_value"
else
echo "No matching pattern found in the commit message."
fi