Skip to content

Conversation

felix-kaestner
Copy link
Contributor

The resulting changes make to the pipeline:

diff --git a/.github/workflows/container-registry-ghcr.yaml b/.github/workflows/container-registry-ghcr.yaml
index 73910f5..1755f62 100644
--- a/.github/workflows/container-registry-ghcr.yaml
+++ b/.github/workflows/container-registry-ghcr.yaml
@@ -44,6 +44,12 @@ jobs:
             type=semver,pattern=v{{major}}
             # https://github.com/docker/metadata-action#typesha
             type=sha,format=long
+      - name: Extract build-args for Docker
+        id: build_args
+        run: |
+          echo "version=$(git describe --tags --always --abbrev=7)" >> $GITHUB_OUTPUT
+          echo "commit=$(git rev-parse --verify HEAD)" >> $GITHUB_OUTPUT
+          echo "date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
       - name: Set up QEMU
         uses: docker/setup-qemu-action@v3
       - name: Set up Docker Buildx
@@ -51,6 +57,10 @@ jobs:
       - name: Build and push Docker image
         uses: docker/build-push-action@v6
         with:
+          build-args: |
+            BININFO_VERSION=${{ steps.build_args.outputs.version }}
+            BININFO_COMMIT_HASH=${{ steps.build_args.outputs.commit }}
+            BININFO_BUILD_DATE=${{ steps.build_args.outputs.date }}
           context: .
           labels: ${{ steps.meta.outputs.labels }}
           platforms: linux/amd64,linux/arm64

@coveralls
Copy link

Coverage Status

coverage: 3.35%. remained the same
when pulling 2885728 on feat/provide-bininfo-build-args
into 28cdfbb on main.

@majewsky
Copy link
Contributor

Anything we can help with here? The changeset seems fine to me.

@felix-kaestner
Copy link
Contributor Author

Anything we can help with here? The changeset seems fine to me.

Thanks for the offer, but I don't think so. I just haven't found the time to fully test my changes. Once I have done that, I would simply put the PR to non-draft and let you know, if that's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants