Skip to content

Commit 4dceccc

Browse files
authored
Merge pull request #719 from stakater/disable-pr-target
Switch PR workflow to pull_request
2 parents 43ea11a + 80c54f8 commit 4dceccc

File tree

1 file changed

+26
-77
lines changed

1 file changed

+26
-77
lines changed

.github/workflows/pull_request.yaml

+26-77
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Pull Request
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
branches:
66
- master
77
paths:
@@ -107,70 +107,19 @@ jobs:
107107
- name: Set up Docker Buildx
108108
uses: docker/setup-buildx-action@v3
109109

110-
- name: Login to Docker Registry
111-
uses: docker/login-action@v3
112-
with:
113-
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
114-
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
115-
116-
- name: Generate image repository path for Docker registry
117-
run: |
118-
echo DOCKER_IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
119-
120-
- name: Build and Push Docker Image to Docker registry
121-
uses: docker/build-push-action@v5
122-
with:
123-
context: .
124-
file: ${{ env.DOCKER_FILE_PATH }}
125-
pull: true
126-
push: true
127-
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
128-
cache-to: type=inline
129-
platforms: linux/amd64,linux/arm,linux/arm64
130-
tags: |
131-
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
132-
labels: |
133-
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
134-
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
135-
org.opencontainers.image.revision=${{ github.sha }}
136-
137-
- name: Build and Push Docker UBI Image to Docker registry
138-
uses: docker/build-push-action@v5
139-
with:
140-
context: .
141-
file: ${{ env.DOCKER_UBI_FILE_PATH }}
142-
pull: true
143-
push: true
144-
build-args: |
145-
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
146-
BUILDER_IMAGE=${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
147-
cache-to: type=inline
148-
platforms: linux/amd64,linux/arm64
149-
tags: |
150-
${{ env.DOCKER_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}
151-
labels: |
152-
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
153-
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
154-
org.opencontainers.image.revision=${{ github.sha }}
155-
156-
- name: Login to ghcr registry
157-
uses: docker/login-action@v3
158-
with:
159-
registry: ${{env.REGISTRY}}
160-
username: ${{github.actor}}
161-
password: ${{secrets.GITHUB_TOKEN}}
162-
163110
- name: Generate image repository path for ghcr registry
164111
run: |
165112
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
166113
167-
- name: Build and Push Docker Image to ghcr registry
114+
# To identify any broken changes in dockerfiles or dependencies
115+
116+
- name: Build Docker Image
168117
uses: docker/build-push-action@v5
169118
with:
170119
context: .
171120
file: ${{ env.DOCKER_FILE_PATH }}
172121
pull: true
173-
push: true
122+
push: false
174123
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
175124
cache-to: type=inline
176125
platforms: linux/amd64,linux/arm,linux/arm64
@@ -181,13 +130,13 @@ jobs:
181130
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
182131
org.opencontainers.image.revision=${{ github.sha }}
183132
184-
- name: Build and Push Docker UBI Image to ghcr registry
133+
- name: Build Docker UBI Image
185134
uses: docker/build-push-action@v5
186135
with:
187136
context: .
188137
file: ${{ env.DOCKER_UBI_FILE_PATH }}
189138
pull: true
190-
push: true
139+
push: false
191140
build-args: |
192141
BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
193142
BUILDER_IMAGE=${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
@@ -200,22 +149,22 @@ jobs:
200149
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
201150
org.opencontainers.image.revision=${{ github.sha }}
202151
203-
- name: Comment on PR
204-
uses: mshick/add-pr-comment@v2
205-
if: always()
206-
env:
207-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
208-
with:
209-
message-success: '@${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
210-
message-failure: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
211-
allow-repeats: true
212-
213-
- name: Notify Slack
214-
uses: 8398a7/action-slack@v3
215-
if: always() # Pick up events even if the job fails or is canceled.
216-
with:
217-
status: ${{ job.status }}
218-
fields: repo,author,action,eventName,ref,workflow
219-
env:
220-
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
221-
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
152+
# - name: Comment on PR
153+
# uses: mshick/add-pr-comment@v2
154+
# if: always()
155+
# env:
156+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
157+
# with:
158+
# message-success: '@${{ github.actor }} Images are available for testing. `docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`\n`docker pull ${{ env.GHCR_IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_UBI_TAG }}`'
159+
# message-failure: '@${{ github.actor }} Yikes! You better fix it before anyone else finds out! [Build](https://github.com/${{ github.repository }}/commit/${{ github.event.pull_request.head.sha }}/checks) has Failed!'
160+
# allow-repeats: true
161+
162+
# - name: Notify Slack
163+
# uses: 8398a7/action-slack@v3
164+
# if: always() # Pick up events even if the job fails or is canceled.
165+
# with:
166+
# status: ${{ job.status }}
167+
# fields: repo,author,action,eventName,ref,workflow
168+
# env:
169+
# GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
170+
# SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)