fix(build): Remove PR tagged images

Unfortunately, these only function for in org, and cause workflows from forks to fail
This commit is contained in:
RJ Trujillo 2023-08-29 08:31:51 -06:00 committed by GitHub
parent efe06f2ba1
commit c6794174df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,8 +10,6 @@ on:
- '**.txt' - '**.txt'
- 'repo_content/**' - 'repo_content/**'
- 'spec_files/**' - 'spec_files/**'
pull_request_review:
type: [submitted]
push: push:
branches: branches:
- main - main
@ -28,7 +26,6 @@ env:
jobs: jobs:
push-ghcr: push-ghcr:
name: Build and push image name: Build and push image
if: github.event.review.state == 'approved' || github.event_name != 'pull_request_review'
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
permissions: permissions:
contents: read contents: read
@ -100,7 +97,7 @@ jobs:
BUILD_TAGS+=("latest") BUILD_TAGS+=("latest")
fi fi
if [[ "${{ github.event_name }}" == "pull_request_review" ]]; then if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Generated the following commit tags: " echo "Generated the following commit tags: "
for TAG in "${COMMIT_TAGS[@]}"; do for TAG in "${COMMIT_TAGS[@]}"; do
echo "${TAG}" echo "${TAG}"
@ -167,7 +164,7 @@ jobs:
- name: Push To GHCR - name: Push To GHCR
uses: redhat-actions/push-to-registry@v2 uses: redhat-actions/push-to-registry@v2
id: push id: push
if: github.event.review.state == 'approved' || github.event_name != 'pull_request' if: github.event_name != 'pull_request'
env: env:
REGISTRY_USER: ${{ github.actor }} REGISTRY_USER: ${{ github.actor }}
REGISTRY_PASSWORD: ${{ github.token }} REGISTRY_PASSWORD: ${{ github.token }}
@ -182,7 +179,7 @@ jobs:
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v2 uses: docker/login-action@v2
if: github.event.review.state == 'approved' || github.event_name != 'pull_request' if: github.event_name != 'pull_request'
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@ -190,10 +187,10 @@ jobs:
# Sign container # Sign container
- uses: sigstore/cosign-installer@v3.1.1 - uses: sigstore/cosign-installer@v3.1.1
if: github.event.review.state == 'approved' || github.event_name != 'pull_request' if: github.event_name != 'pull_request'
- name: Sign container image - name: Sign container image
if: github.event.review.state == 'approved' || github.event_name != 'pull_request' if: github.event_name != 'pull_request'
run: | run: |
cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}@${TAGS} cosign sign -y --key env://COSIGN_PRIVATE_KEY ${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}@${TAGS}
env: env:
@ -202,6 +199,6 @@ jobs:
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
- name: Echo outputs - name: Echo outputs
if: github.event.review.state == 'approved' || github.event_name != 'pull_request' if: github.event_name != 'pull_request'
run: | run: |
echo "${{ toJSON(steps.push.outputs) }}" echo "${{ toJSON(steps.push.outputs) }}"