From 6a00baf235f3583eb8c55060793947d65fcd1b58 Mon Sep 17 00:00:00 2001 From: Mathias Fredriksson Date: Fri, 26 Aug 2022 17:38:40 +0300 Subject: [PATCH] fix: Transform branch name to valid Docker tag for dogfood (#3703) --- .github/workflows/dogfood.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index 0e0e294934..28fe7f6fa9 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -21,6 +21,14 @@ jobs: id: branch-name uses: tj-actions/branch-names@v5.4 + - name: "Branch name to Docker tag name" + id: docker-tag-name + run: | + tag=${{ steps.branch-name.outputs.current_branch }} + # Replace / with --, e.g. user/feature => user--feature. + tag=${tag//\//--} + echo "::set-output name=tag::${tag}" + - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -38,6 +46,6 @@ jobs: with: context: "{{defaultContext}}:dogfood" push: true - tags: "codercom/oss-dogfood:${{ steps.branch-name.outputs.current_branch }},codercom/oss-dogfood:latest" + tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest" cache-from: type=registry,ref=codercom/oss-dogfood:latest cache-to: type=inline