Skip to content

Commit 15f803d

Browse files
authored
Switch PR workflow to pull_request (#602)
1 parent bc7f450 commit 15f803d

File tree

1 file changed

+40
-73
lines changed

1 file changed

+40
-73
lines changed

.github/workflows/pull_request.yml

Lines changed: 40 additions & 73 deletions
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-ignore:
@@ -50,26 +50,26 @@ jobs:
5050
run: |
5151
helm lint charts/ingressmonitorcontroller
5252
53-
- name: Install kind
54-
uses: engineerd/[email protected]
55-
with:
56-
version: ${{ env.KIND_VERSION }}
53+
# - name: Install kind
54+
# uses: engineerd/[email protected]
55+
# with:
56+
# version: ${{ env.KIND_VERSION }}
5757

58-
- name: Check cluster info
59-
run: |
60-
kubectl version --client
61-
kind version
62-
kind version | grep -q ${KIND_VERSION}
58+
# - name: Check cluster info
59+
# run: |
60+
# kubectl version --client
61+
# kind version
62+
# kind version | grep -q ${KIND_VERSION}
6363

64-
- name: Set up Cluster
65-
run: |
66-
kubectl cluster-info
67-
make install
68-
mkdir -p .local
69-
echo "${{ secrets.SECRET_KUBERNETES_RESOURCES }}" | base64 --decode > .local/test-config.yaml
64+
# - name: Set up Cluster
65+
# run: |
66+
# kubectl cluster-info
67+
# make install
68+
# mkdir -p .local
69+
# echo "${{ secrets.SECRET_KUBERNETES_RESOURCES }}" | base64 --decode > .local/test-config.yaml
7070

71-
- name: Test
72-
run: make test
71+
# - name: Test
72+
# run: make test
7373

7474
- name: Generate Tag
7575
id: generate_tag
@@ -86,24 +86,19 @@ jobs:
8686
with:
8787
buildkitd-flags: --debug
8888

89-
- name: Login to ghcr registry
90-
uses: docker/login-action@v3
91-
with:
92-
registry: ${{env.REGISTRY}}
93-
username: stakater-user
94-
password: ${{secrets.GITHUB_TOKEN}}
95-
9689
- name: Generate image repository path for ghcr registry
9790
run: |
9891
echo GHCR_IMAGE_REPOSITORY=${{env.REGISTRY}}/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
9992
100-
- name: Build and Push image to ghcr registry
93+
# To identify any broken changes in dockerfiles or dependencies
94+
95+
- name: Build image
10196
uses: docker/build-push-action@v5
10297
with:
10398
context: .
10499
file: ${{ env.DOCKER_FILE_PATH }}
105100
pull: true
106-
push: true
101+
push: false
107102
cache-from: type=gha
108103
cache-to: type=gha,mode=max
109104
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
@@ -115,49 +110,21 @@ jobs:
115110
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
116111
org.opencontainers.image.revision=${{ github.sha }}
117112
118-
- name: Login to DockerHub Registry
119-
uses: docker/login-action@v3
120-
with:
121-
username: ${{ secrets.STAKATER_DOCKERHUB_USERNAME }}
122-
password: ${{ secrets.STAKATER_DOCKERHUB_PASSWORD }}
123-
124-
- name: Generate image repository path for dockerhub registry
125-
run: |
126-
echo IMAGE_REPOSITORY=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
127-
128-
- name: Build and push to DockerHub registry
129-
uses: docker/build-push-action@v5
130-
with:
131-
context: .
132-
file: ${{ env.DOCKER_FILE_PATH }}
133-
pull: true
134-
push: true
135-
build-args: BUILD_PARAMETERS=${{ env.BUILD_PARAMETERS }}
136-
cache-from: type=gha
137-
cache-to: type=gha,mode=max
138-
platforms: linux/amd64,linux/arm,linux/arm64
139-
tags: |
140-
${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}
141-
labels: |
142-
org.opencontainers.image.source=${{ github.event.repository.clone_url }}
143-
org.opencontainers.image.created=${{ steps.prep.outputs.created }}
144-
org.opencontainers.image.revision=${{ github.sha }}
145-
146-
- name: Comment on PR
147-
uses: mshick/add-pr-comment@v2
148-
if: always()
149-
env:
150-
GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
151-
with:
152-
message-success: '@${{ github.actor }} Image is available for testing. `docker pull ${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`'
153-
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!'
154-
allow-repeats: false
155-
156-
- name: Notify Slack
157-
uses: 8398a7/action-slack@v3
158-
if: always() # Pick up events even if the job fails or is canceled.
159-
with:
160-
status: ${{ job.status }}
161-
fields: repo,author,action,eventName,ref,workflow
162-
env:
163-
SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}
113+
# - name: Comment on PR
114+
# uses: mshick/add-pr-comment@v2
115+
# if: always()
116+
# env:
117+
# GITHUB_TOKEN: ${{ secrets.STAKATER_GITHUB_TOKEN }}
118+
# with:
119+
# message-success: '@${{ github.actor }} Image is available for testing. `docker pull ${{ env.IMAGE_REPOSITORY }}:${{ steps.generate_tag.outputs.GIT_TAG }}`'
120+
# 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!'
121+
# allow-repeats: false
122+
123+
# - name: Notify Slack
124+
# uses: 8398a7/action-slack@v3
125+
# if: always() # Pick up events even if the job fails or is canceled.
126+
# with:
127+
# status: ${{ job.status }}
128+
# fields: repo,author,action,eventName,ref,workflow
129+
# env:
130+
# SLACK_WEBHOOK_URL: ${{ secrets.STAKATER_DELIVERY_SLACK_WEBHOOK }}

0 commit comments

Comments
 (0)