From c478425b3dd170df4805da347698af6d00a390bb Mon Sep 17 00:00:00 2001 From: Brian Sipos Date: Wed, 21 Aug 2024 20:14:30 -0400 Subject: [PATCH] Use safe-characters for CI image tag (#124) --- .github/workflows/build-test.yaml | 5 ++++- .gitlab-ci.yml | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test.yaml b/.github/workflows/build-test.yaml index e0ca728..a12af85 100644 --- a/.github/workflows/build-test.yaml +++ b/.github/workflows/build-test.yaml @@ -12,7 +12,6 @@ jobs: runs-on: ubuntu-latest env: DOCKER_BUILDKIT: "1" - DOCKER_IMAGE_TAG: ${{ github.head_ref || github.ref_name }} AUTHNZ_EMU: "1" ANMS_COMPOSE_OPTS: "-f docker-compose.yml -p anms" AGENT_COMPOSE_OPTS: "-f agent-compose.yml -p agents" @@ -26,6 +25,10 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive + - name: Tag name env + run: | + DOCKER_IMAGE_TAG=$(echo ${{ github.head_ref || github.ref_name }} | sed 's/[^a-zA-Z0-9\-\._]/-/g') + echo "DOCKER_IMAGE_TAG=${DOCKER_IMAGE_TAG}" >> $GITHUB_ENV - name: Build run: | ./build.sh buildonly diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 17e15f5..7369412 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -46,7 +46,7 @@ variables: # for Ruby/bolt SSL_CERT_FILE: /etc/pki/tls/certs/ca-bundle.crt # Project-specific environment - DOCKER_IMAGE_TAG: $CI_COMMIT_REF_NAME + DOCKER_IMAGE_TAG: $CI_COMMIT_REF_SLUG DOCKER_IMAGE_PREFIX: $DOCKER_REGISTRY/$DOCKER_GROUP/ AUTHNZ_EMU: 1 ANMS_COMPOSE_OPTS: -f docker-compose.yml -p anms