From 415f4e972dc917a9ab6be6c3cd708f4a1e511809 Mon Sep 17 00:00:00 2001 From: kixelated Date: Sun, 17 Sep 2023 22:29:32 -0700 Subject: [PATCH] Don't run the publish workflow on PR. (#76) It takes foooorever and we have a separate check. --- .github/workflows/publish.yml | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index bae66e4..76f52da 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -6,14 +6,10 @@ name: Publish Docker Image # documentation. on: - schedule: - - cron: "26 7 * * *" push: branches: ["main"] # Publish semver tags as releases. tags: ["v*.*.*"] - pull_request: - branches: ["main"] env: # Use docker.io for Docker Hub if empty @@ -35,10 +31,9 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - # Install the cosign tool except on PR + # Install the cosign tool # https://github.com/sigstore/cosign-installer - name: Install cosign - if: github.event_name != 'pull_request' uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1 with: cosign-release: "v2.1.1" @@ -49,10 +44,9 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 - # Login against a Docker registry except on PR + # Login against a Docker registry # https://github.com/docker/login-action - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 with: registry: ${{ env.REGISTRY }} @@ -74,20 +68,18 @@ jobs: uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 with: context: . - push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} platforms: linux/amd64,linux/arm64 cache-from: type=gha cache-to: type=gha,mode=max - # Sign the resulting Docker image digest except on PRs. + # Sign the resulting Docker image digest # This will only write to the public Rekor transparency log when the Docker # repository is public to avoid leaking data. If you would like to publish # transparency data even for private images, pass --force to cosign below. # https://github.com/sigstore/cosign - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} env: # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable TAGS: ${{ steps.meta.outputs.tags }}