From e909c8a743b8477fce1147108b3be7327ee19b4a Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 13:55:32 +0100 Subject: [PATCH 01/12] try out creating metadata file in image branch --- .github/workflows/docker-build-push.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 6b235ac..05cc8c3 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -145,6 +145,28 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + - name: Checkout GitHub repository + # https://github.com/actions/checkout + uses: actions/checkout@v4 + + - name: Protector Metadata + run: | + jq -n \ + --arg repoVar ${{ github.repository }} \ + --arg branchShell $(git rev-parse --abbrev-ref HEAD) \ + --arg branchVarRefName ${{ github.ref_name }} \ + --arg revisionShell $(git rev-parse HEAD) \ + --arg revisionVarSha ${{ github.sha }} \ + --arg revisionDate "$(git show -s --format=%ci HEAD)" \ + '{ \ + gitBranchShell: $branchShell, \ + gitBranchVar: $branchVarRefName, \ + gitRevisionShell: $revisionShell, \ + gitRevisionVar: $revisionVarSha, \ + gitRevisionDate: $revisionDate \ + }' \ + > protector_metadata.json + - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV @@ -168,6 +190,7 @@ jobs: file: ${{ inputs.DOCKERFILE_PATH }} tags: ${{ steps.meta-branch.outputs.tags }} build-args: ${{ secrets.BUILD_ARGS }} + context: . delete-branch-image: if: ${{ github.event_name == 'delete' && github.event.ref_type == 'branch' && startsWith(github.event.ref, 'preview/') }} From 3d08b00f81cf0aa8aa618aaf94cbfff588b0d3f9 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 16:03:36 +0100 Subject: [PATCH 02/12] remove spaces after backslash --- .github/workflows/docker-build-push.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 05cc8c3..60a5a7b 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -151,18 +151,18 @@ jobs: - name: Protector Metadata run: | - jq -n \ + jq -n \ --arg repoVar ${{ github.repository }} \ --arg branchShell $(git rev-parse --abbrev-ref HEAD) \ --arg branchVarRefName ${{ github.ref_name }} \ --arg revisionShell $(git rev-parse HEAD) \ --arg revisionVarSha ${{ github.sha }} \ - --arg revisionDate "$(git show -s --format=%ci HEAD)" \ + --arg revisionDate "$(git show -s --format=%ci HEAD)" \ '{ \ - gitBranchShell: $branchShell, \ - gitBranchVar: $branchVarRefName, \ - gitRevisionShell: $revisionShell, \ - gitRevisionVar: $revisionVarSha, \ + gitBranchShell: $branchShell, \ + gitBranchVar: $branchVarRefName, \ + gitRevisionShell: $revisionShell, \ + gitRevisionVar: $revisionVarSha, \ gitRevisionDate: $revisionDate \ }' \ > protector_metadata.json From 478c31d816cf16c48eacd7c996e2dd54c93986c2 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 16:17:28 +0100 Subject: [PATCH 03/12] try to get it running at all --- .github/workflows/docker-build-push.yml | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 60a5a7b..5347ea5 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -151,21 +151,7 @@ jobs: - name: Protector Metadata run: | - jq -n \ - --arg repoVar ${{ github.repository }} \ - --arg branchShell $(git rev-parse --abbrev-ref HEAD) \ - --arg branchVarRefName ${{ github.ref_name }} \ - --arg revisionShell $(git rev-parse HEAD) \ - --arg revisionVarSha ${{ github.sha }} \ - --arg revisionDate "$(git show -s --format=%ci HEAD)" \ - '{ \ - gitBranchShell: $branchShell, \ - gitBranchVar: $branchVarRefName, \ - gitRevisionShell: $revisionShell, \ - gitRevisionVar: $revisionVarSha, \ - gitRevisionDate: $revisionDate \ - }' \ - > protector_metadata.json + jq -n --arg repoVar ${{ github.repository }} --arg branchShell $(git rev-parse --abbrev-ref HEAD) --arg branchVarRefName ${{ github.ref_name }} --arg revisionShell $(git rev-parse HEAD) --arg revisionVarSha ${{ github.sha }} --arg revisionDate "$(git show -s --format=%ci HEAD)" '{gitBranchShell: $branchShell, gitBranchVar: $branchVarRefName, gitRevisionShell: $revisionShell, gitRevisionVar: $revisionVarSha, gitRevisionDate: $revisionDate}' > protector_metadata.json - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV From 03b1ece74cef0f8b349346bab0ab1d67eb728951 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 16:22:40 +0100 Subject: [PATCH 04/12] try a newline --- .github/workflows/docker-build-push.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 5347ea5..f8da253 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -151,7 +151,8 @@ jobs: - name: Protector Metadata run: | - jq -n --arg repoVar ${{ github.repository }} --arg branchShell $(git rev-parse --abbrev-ref HEAD) --arg branchVarRefName ${{ github.ref_name }} --arg revisionShell $(git rev-parse HEAD) --arg revisionVarSha ${{ github.sha }} --arg revisionDate "$(git show -s --format=%ci HEAD)" '{gitBranchShell: $branchShell, gitBranchVar: $branchVarRefName, gitRevisionShell: $revisionShell, gitRevisionVar: $revisionVarSha, gitRevisionDate: $revisionDate}' > protector_metadata.json + jq -n \ + --arg repoVar ${{ github.repository }} --arg branchShell $(git rev-parse --abbrev-ref HEAD) --arg branchVarRefName ${{ github.ref_name }} --arg revisionShell $(git rev-parse HEAD) --arg revisionVarSha ${{ github.sha }} --arg revisionDate "$(git show -s --format=%ci HEAD)" '{gitBranchShell: $branchShell, gitBranchVar: $branchVarRefName, gitRevisionShell: $revisionShell, gitRevisionVar: $revisionVarSha, gitRevisionDate: $revisionDate}' > protector_metadata.json - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV From 38c60a80262fc800451809c87bfb7de404ad1b9c Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 16:26:47 +0100 Subject: [PATCH 05/12] try bash --- .github/workflows/docker-build-push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index f8da253..52900eb 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -150,6 +150,7 @@ jobs: uses: actions/checkout@v4 - name: Protector Metadata + shell: bash run: | jq -n \ --arg repoVar ${{ github.repository }} --arg branchShell $(git rev-parse --abbrev-ref HEAD) --arg branchVarRefName ${{ github.ref_name }} --arg revisionShell $(git rev-parse HEAD) --arg revisionVarSha ${{ github.sha }} --arg revisionDate "$(git show -s --format=%ci HEAD)" '{gitBranchShell: $branchShell, gitBranchVar: $branchVarRefName, gitRevisionShell: $revisionShell, gitRevisionVar: $revisionVarSha, gitRevisionDate: $revisionDate}' > protector_metadata.json From d12c35e8258cac4bd159179b7bfb4a4305265898 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 16:50:55 +0100 Subject: [PATCH 06/12] try another notation --- .github/workflows/docker-build-push.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 52900eb..0e3edd7 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -151,9 +151,13 @@ jobs: - name: Protector Metadata shell: bash - run: | - jq -n \ - --arg repoVar ${{ github.repository }} --arg branchShell $(git rev-parse --abbrev-ref HEAD) --arg branchVarRefName ${{ github.ref_name }} --arg revisionShell $(git rev-parse HEAD) --arg revisionVarSha ${{ github.sha }} --arg revisionDate "$(git show -s --format=%ci HEAD)" '{gitBranchShell: $branchShell, gitBranchVar: $branchVarRefName, gitRevisionShell: $revisionShell, gitRevisionVar: $revisionVarSha, gitRevisionDate: $revisionDate}' > protector_metadata.json + run: > + jq -n + --arg repo ${{ github.repository }} + --arg branch ${{ github.ref_name }} + --arg revision ${{ github.sha }} + --arg buildDate $(date) + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV From 4a04c9023bf7cf8c0cecc1ac60b3f58c2b57021c Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 17:01:12 +0100 Subject: [PATCH 07/12] try another notation with backslash --- .github/workflows/docker-build-push.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 0e3edd7..6c19693 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -152,11 +152,11 @@ jobs: - name: Protector Metadata shell: bash run: > - jq -n - --arg repo ${{ github.repository }} - --arg branch ${{ github.ref_name }} - --arg revision ${{ github.sha }} - --arg buildDate $(date) + jq -n \ + --arg repo ${{ github.repository }} \ + --arg branch ${{ github.ref_name }} \ + --arg revision ${{ github.sha }} \ + --arg buildDate $(date) \ '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json - name: Get branch name From 32d8d6233e322698989a103dcf352336b0508945 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 17:05:50 +0100 Subject: [PATCH 08/12] escape date string --- .github/workflows/docker-build-push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 6c19693..946cbca 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -156,7 +156,7 @@ jobs: --arg repo ${{ github.repository }} \ --arg branch ${{ github.ref_name }} \ --arg revision ${{ github.sha }} \ - --arg buildDate $(date) \ + --arg buildDate "$(date --iso-8601=seconds --utc)" \ '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json - name: Get branch name From 1e0d211ed02686274b2cc3bda31c1a756ca2e3b3 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Thu, 12 Feb 2026 17:20:58 +0100 Subject: [PATCH 09/12] verify metadata file --- .github/workflows/docker-build-push.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 946cbca..e2dd5a2 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -159,6 +159,10 @@ jobs: --arg buildDate "$(date --iso-8601=seconds --utc)" \ '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json + - name: Verify Metadata + shell: bash + run: cat protector_metadata.json + - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV From 8575965e6cdf877845de5cd5674e453fc47c5511 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Fri, 13 Feb 2026 11:14:57 +0100 Subject: [PATCH 10/12] see whats going on --- .github/workflows/docker-build-push.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index e2dd5a2..50b8e57 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -163,6 +163,14 @@ jobs: shell: bash run: cat protector_metadata.json + - name: PWD + shell: bash + run: pwd + + - name: PWD + shell: bash + run: ls -al + - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV From 6ab3be3f4e001c39bde3b65417f46366ac20c487 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Fri, 13 Feb 2026 13:18:03 +0100 Subject: [PATCH 11/12] generate Protector metadata for all image types --- .github/workflows/docker-build-push.yml | 50 ++++++++++++++++--------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 50b8e57..8324613 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -33,6 +33,16 @@ jobs: # https://github.com/actions/checkout uses: actions/checkout@v4 + - name: Protector Metadata + shell: bash + run: > + jq -n \ + --arg repo ${{ github.repository }} \ + --arg branch ${{ github.ref_name }} \ + --arg revision ${{ github.sha }} \ + --arg buildDate "$(date --iso-8601=seconds --utc)" \ + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json + - name: Login to Docker Hub # https://github.com/docker/login-action uses: docker/login-action@v3 @@ -73,6 +83,7 @@ jobs: file: ${{ inputs.DOCKERFILE_PATH }} tags: ${{ steps.meta-production.outputs.tags }} build-args: ${{ secrets.BUILD_ARGS }} + context: . - name: Sync README with Docker Hub description if: ${{ github.ref_name == env.LATEST_TAG }} @@ -89,6 +100,20 @@ jobs: runs-on: ubuntu-latest steps: + - name: Checkout GitHub repository + # https://github.com/actions/checkout + uses: actions/checkout@v4 + + - name: Protector Metadata + shell: bash + run: > + jq -n \ + --arg repo ${{ github.repository }} \ + --arg branch ${{ github.ref_name }} \ + --arg revision ${{ github.sha }} \ + --arg buildDate "$(date --iso-8601=seconds --utc)" \ + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json + - name: Login to Docker Hub # https://github.com/docker/login-action uses: docker/login-action@v3 @@ -119,6 +144,7 @@ jobs: file: ${{ inputs.DOCKERFILE_PATH }} tags: ${{ steps.meta-pr.outputs.tags }} build-args: ${{ secrets.BUILD_ARGS }} + context: . delete-pr-image: if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' }} @@ -138,13 +164,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Login to Docker Hub - # https://github.com/docker/login-action - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Checkout GitHub repository # https://github.com/actions/checkout uses: actions/checkout@v4 @@ -159,17 +178,12 @@ jobs: --arg buildDate "$(date --iso-8601=seconds --utc)" \ '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json - - name: Verify Metadata - shell: bash - run: cat protector_metadata.json - - - name: PWD - shell: bash - run: pwd - - - name: PWD - shell: bash - run: ls -al + - name: Login to Docker Hub + # https://github.com/docker/login-action + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Get branch name run: echo "BRANCH_NAME=$(echo ${{ github.ref_name }} | tr / -)" >> $GITHUB_ENV From 29eed0caa204e224c5c533a428ff48524eaea927 Mon Sep 17 00:00:00 2001 From: Gael Connan Date: Fri, 13 Feb 2026 13:24:04 +0100 Subject: [PATCH 12/12] add build date --- .github/workflows/docker-build-push.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index 8324613..adf2684 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -41,7 +41,7 @@ jobs: --arg branch ${{ github.ref_name }} \ --arg revision ${{ github.sha }} \ --arg buildDate "$(date --iso-8601=seconds --utc)" \ - '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, buildDate: $buildDate}' > protector_metadata.json - name: Login to Docker Hub # https://github.com/docker/login-action @@ -112,7 +112,7 @@ jobs: --arg branch ${{ github.ref_name }} \ --arg revision ${{ github.sha }} \ --arg buildDate "$(date --iso-8601=seconds --utc)" \ - '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, buildDate: $buildDate}' > protector_metadata.json - name: Login to Docker Hub # https://github.com/docker/login-action @@ -176,7 +176,7 @@ jobs: --arg branch ${{ github.ref_name }} \ --arg revision ${{ github.sha }} \ --arg buildDate "$(date --iso-8601=seconds --utc)" \ - '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, }' > protector_metadata.json + '{gitRepo: $repo, gitBranch: $branch, gitRevision: $revision, buildDate: $buildDate}' > protector_metadata.json - name: Login to Docker Hub # https://github.com/docker/login-action