From e626eb546d16877c0a07a00fc1920b482b3854ba Mon Sep 17 00:00:00 2001 From: Damyan Yordanov Date: Wed, 25 Sep 2024 15:58:51 +0200 Subject: [PATCH 1/2] Do not push PR images Push will fail anyways with `403` when pushing from a fork --- .github/workflows/publish-docker.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 1684f04..7a72ed6 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -59,6 +59,7 @@ jobs: version: latest endpoint: builders - name: Login to GHCR + if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.registry }} @@ -70,6 +71,6 @@ jobs: with: context: . platforms: ${{ env.platforms }} - push: true + if: github.event_name != 'pull_request' tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} From ff6ff8e19e015a8181e1f142029d7755dc318e11 Mon Sep 17 00:00:00 2001 From: Damyan Yordanov Date: Wed, 25 Sep 2024 16:01:16 +0200 Subject: [PATCH 2/2] Change size labeling action's trigger event Change to `pull_request_target`, so fork builds don't fail --- .github/workflows/size-label.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/size-label.yml b/.github/workflows/size-label.yml index 85d18d3..10708d5 100644 --- a/.github/workflows/size-label.yml +++ b/.github/workflows/size-label.yml @@ -1,14 +1,17 @@ name: Size Label on: - pull_request: - -permissions: - contents: read - pull-requests: write + pull_request_target: + types: + - opened + - edited + - synchronize jobs: size-label: + permissions: + contents: read + pull-requests: write runs-on: ubuntu-latest steps: - name: size-label