diff --git a/.github/workflows/ci-main.yml b/.github/workflows/ci-main.yml index 8aa3126eb..c7706b24f 100644 --- a/.github/workflows/ci-main.yml +++ b/.github/workflows/ci-main.yml @@ -197,7 +197,7 @@ jobs: with: push: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} tags: | - beryju.org/authentik/server:gh-${{ steps.ev.outputs.branchName }}, - beryju.org/authentik/server:gh-${{ env.GITHUB_SHA }} + beryju.org/authentik/server:gh-${{ steps.ev.outputs.branchName }} + beryju.org/authentik/server:gh-${{ steps.ev.outputs.sha }} build-args: | - GIT_BUILD_HASH=${{ env.GITHUB_SHA }} + GIT_BUILD_HASH=${{ steps.ev.outputs.sha }} diff --git a/.github/workflows/ci-outpost.yml b/.github/workflows/ci-outpost.yml index 2abfd8647..a225d4152 100644 --- a/.github/workflows/ci-outpost.yml +++ b/.github/workflows/ci-outpost.yml @@ -57,10 +57,10 @@ jobs: with: push: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} tags: | - beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }}, - beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }}-${{ steps.ev.outputs.timestamp }}, - beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ env.GITHUB_SHA }} + beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }} + beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.branchName }}-${{ steps.ev.outputs.timestamp }} + beryju.org/authentik/outpost-${{ matrix.type }}:gh-${{ steps.ev.outputs.sha }} file: ${{ matrix.type }}.Dockerfile platforms: linux/amd64,linux/arm64 build-args: | - GIT_BUILD_HASH=${{ env.GITHUB_SHA }} + GIT_BUILD_HASH=${{ steps.ev.outputs.sha }} diff --git a/scripts/gh_do_set_branch.py b/scripts/gh_do_set_branch.py index 644abb115..1c473bf24 100644 --- a/scripts/gh_do_set_branch.py +++ b/scripts/gh_do_set_branch.py @@ -4,10 +4,13 @@ from time import time env_pr_branch = "GITHUB_HEAD_REF" default_branch = "GITHUB_REF" +sha = "GITHUB_SHA" branch_name = os.environ[default_branch] -if env_pr_branch in os.environ: - branch_name = os.environ[env_pr_branch].replace("/", "-") +if os.environ.get(env_pr_branch, "") != "": + branch_name = os.environ[env_pr_branch] +branch_name = branch_name.replace("refs/heads/", "").replace("/", "-") print("##[set-output name=branchName]%s" % branch_name) print("##[set-output name=timestamp]%s" % int(time())) +print("##[set-output name=sha]%s" % os.environ[sha])