Skip to content

Commit fa53045

Browse files
committed
CCM-11751: Package and publish modules to Github
1 parent 9eec307 commit fa53045

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ jobs:
3535
run: |
3636
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
3737
BUILD_DATETIME=$datetime make version-create-effective-file dir=.
38-
version=$(head -n 1 .version 2> /dev/null || echo unknown)
38+
branch_name=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
39+
if [[ "$branch_name" == "main" ]]; then
40+
version=$(head -n 1 .version 2> /dev/null || echo unknown)
41+
else
42+
# Clean branch name by removing special characters and converting to lowercase
43+
clean_branch=$(echo "$branch_name" | tr -dc '[:alnum:]\n\r' | tr '[:upper:]' '[:lower:]')
44+
version="${clean_branch}"
45+
fi
3946
echo "build_datetime_london=$(TZ=Europe/London date --date=$datetime +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_OUTPUT
4047
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
4148
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)