From edfc242697796faf9e5b9476828554b17c7d8bff Mon Sep 17 00:00:00 2001
From: Marius <sittigmarius@tuta.io>
Date: Tue, 3 Oct 2023 07:47:44 +0200
Subject: [PATCH] Update build.yml

---
 .github/workflows/build.yml | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index 6320a0ec..51b9c8c3 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -13,7 +13,9 @@ jobs:
   build:
     name: Compile and Test
     runs-on: ubuntu-latest
-
+    permissions:
+      contents: read
+      packages: write
     strategy:
       matrix:
         build-type: [Release, RelWithDebInfo]
@@ -109,18 +111,18 @@ jobs:
         id: docker-vars
         with:
           image-name: ghcr.io/${{ github.repository }}/base
-          registry-secret: ${{ secrets.GHCR_PAT }}
+          registry-secret: ${{ secrets.GITHUB_TOKEN }}
       
       - name: Set up Docker Buildx
         uses: docker/setup-buildx-action@v1
 
       - name: Login to GitHub
         if: ${{ steps.docker-vars.outputs.has-docker-secret == 'true' }}
-        uses: docker/login-action@v1
+        uses: docker/login-action@v2
         with:
           registry: ghcr.io
           username: ${{ github.repository_owner }}
-          password: ${{ steps.docker-vars.outputs.docker-secret }}
+          password: ${{ steps.docker-vars.outputs.docker-secret }}          
 
       - name: Build and push
         uses: docker/build-push-action@v2
@@ -133,8 +135,8 @@ jobs:
           labels: |
             org.opencontainers.image.title=${{ fromJson(steps.repo.outputs.result).name }}
             org.opencontainers.image.description=${{ fromJson(steps.repo.outputs.result).description }}
-            org.opencontainers.image.url=${{ fromJson(steps.repo.outputs.result).homepage }}
-            org.opencontainers.image.source=${{ fromJson(steps.repo.outputs.result).html_url }}
+            org.opencontainers.image.url=${{ fromJson(steps.repo.outputs.result).html_url }}
+            org.opencontainers.image.source=${{ fromJson(steps.repo.outputs.result).clone_url }}
             org.opencontainers.image.version=${{ steps.docker-vars.outputs.version }}
             org.opencontainers.image.created=${{ steps.docker-vars.outputs.created }}
             org.opencontainers.image.revision=${{ github.sha }}