From 70560d7d48ca65b8334d2b86f087bdd3d6e4649f Mon Sep 17 00:00:00 2001 From: Jan Wagner Date: Tue, 7 Dec 2021 16:14:29 +0100 Subject: [PATCH] Use github.actor to detect the username for ghcr.io upload --- .github/workflows/build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 06d67ee..b7659d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,9 @@ jobs: - name: Build an image from Dockerfile run: | docker build \ - -t ghcr.io/hoellen/nextcloud \ - -t ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) \ - -t ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2) \ + -t ghcr.io/${{ github.actor }}/nextcloud \ + -t ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) \ + -t ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2) \ . - name: Run Trivy vulnerability scanner @@ -46,6 +46,6 @@ jobs: - name: Push image to GitHub run: | - docker push ghcr.io/hoellen/nextcloud - docker push ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) - docker push ghcr.io/hoellen/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2) + docker push ghcr.io/${{ github.actor }}/nextcloud + docker push ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c6) + docker push ghcr.io/${{ github.actor }}/nextcloud:$(grep -oP '(?<=NEXTCLOUD_VERSION=).*' Dockerfile | head -c2)