From dd96c57f486cc1399f9a967a0fdeb3a88cf16e12 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Wed, 11 Mar 2020 09:44:26 +0100 Subject: [PATCH] Follow up - 0798e7d47ed2505ea43dccdb9c1ef867d700f720 - moved from circle ci to github actions. Fixed bug: GITHUB_ACTOR is the user initiating the commit not the repository owner. Applied workaround to extract the repository owner from the GitHub Actions GITHUB_REPOSITORY ENV instead because there is no dedicated ENV for that. --- .github/docker-image-build.sh | 4 +++- .github/workflows/build-docker-compose-images.yaml | 7 +++---- .github/workflows/build-docker-image.yaml | 5 ++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/docker-image-build.sh b/.github/docker-image-build.sh index a57e49575..5fe19717e 100755 --- a/.github/docker-image-build.sh +++ b/.github/docker-image-build.sh @@ -13,7 +13,9 @@ ZAMMAD_VERSION="$(git describe --tags | sed -e 's/-[a-z0-9]\{8,\}.*//g')" echo "${DOCKER_PASSWORD}" | docker login --username="${DOCKER_USERNAME}" --password-stdin # clone docker repo -git clone https://github.com/"${REPO_USER}"/"${DOCKER_GITHUB_REPOSITORY}" +DOCKER_REPOSITORY_CLONE_URL="https://github.com/${REPO_USER}/${DOCKER_GITHUB_REPOSITORY}" +echo "Cloning ${DOCKER_REPOSITORY_CLONE_URL}" +git clone "${DOCKER_REPOSITORY_CLONE_URL}" # enter dockerfile dir cd "${REPO_ROOT}/${DOCKER_GITHUB_REPOSITORY}" diff --git a/.github/workflows/build-docker-compose-images.yaml b/.github/workflows/build-docker-compose-images.yaml index 2e98d09c2..dee54dc0c 100644 --- a/.github/workflows/build-docker-compose-images.yaml +++ b/.github/workflows/build-docker-compose-images.yaml @@ -14,10 +14,9 @@ jobs: DOCKER_REPOSITORY: "zammad-docker-compose" DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} steps: - - name: Alias GITHUB_ACTOR as REPO_USER - run: | - echo "::set-env name=REPO_USER::$GITHUB_ACTOR" - - name: Checkout code + - name: Extract REPO_USER from GITHUB_REPOSITORY ENV + run: echo "::set-env name=REPO_USER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" + - name: Checkout code uses: actions/checkout@master - name: Fetch all history for all tags and branches run: git fetch --prune --unshallow diff --git a/.github/workflows/build-docker-image.yaml b/.github/workflows/build-docker-image.yaml index a1a4e8389..ee43af20a 100644 --- a/.github/workflows/build-docker-image.yaml +++ b/.github/workflows/build-docker-image.yaml @@ -14,9 +14,8 @@ jobs: DOCKER_REPOSITORY: "zammad" DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} steps: - - name: Alias GITHUB_ACTOR as REPO_USER - run: | - echo "::set-env name=REPO_USER::$GITHUB_ACTOR" + - name: Extract REPO_USER from GITHUB_REPOSITORY ENV + run: echo "::set-env name=REPO_USER::$(echo "$GITHUB_REPOSITORY" | awk -F / '{print $1}')" - name: Checkout code uses: actions/checkout@master - name: Fetch all history for all tags and branches