From aa0948017859104b302a55408a1f9af28a98998d Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Wed, 24 Feb 2021 15:13:41 +0100 Subject: [PATCH 1/2] chore: fix broken docker build caused by github.ref --- .github/workflows/dockerbuild.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 9770fcbe9d..39f7d47453 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -40,15 +40,21 @@ jobs: org.opencontainers.image.authors=Daniel Lando org.opencontainers.image.url=https://zwave-js.github.io/zwavejs2mqtt/#/ maintainer=robertsLando + - uses: actions/github-script@v3 + id: ref-sanitized + with: + script: | + const ref = context.github.ref + return ref.replace(/^refs\/heads\/|-/, '') - name: Cache Docker layers uses: actions/cache@v2 with: path: /tmp/.buildx-cache - key: buildx-${{ github.ref }}-${{ github.sha }} + key: buildx-${{ steps.ref-sanitized.outputs.result }}-${{ github.sha }} restore-keys: | - buildx-${{ github.ref }}-${{ github.sha }} - buildx-${{ github.ref }} + buildx-${{ steps.ref-sanitized.outputs.result }}-${{ github.sha }} + buildx-${{ steps.ref-sanitized.outputs.result }} buildx- - name: build+push From 735a50cb84e46093b8769e9452662cb773f6abfb Mon Sep 17 00:00:00 2001 From: Daniel Lando Date: Wed, 24 Feb 2021 15:15:34 +0100 Subject: [PATCH 2/2] fix: typo --- .github/workflows/dockerbuild.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dockerbuild.yml b/.github/workflows/dockerbuild.yml index 39f7d47453..d23db01c71 100644 --- a/.github/workflows/dockerbuild.yml +++ b/.github/workflows/dockerbuild.yml @@ -44,7 +44,7 @@ jobs: id: ref-sanitized with: script: | - const ref = context.github.ref + const ref = context.ref return ref.replace(/^refs\/heads\/|-/, '') - name: Cache Docker layers