Skip to content

Commit b8231bf

Browse files
authored
Allow contribs by not running cloud tests on them (#2332)
* Remove forked logic on workflows * Do not run cloud tests for contributions Signed-off-by: jose.vazquez <[email protected]> --------- Signed-off-by: jose.vazquez <[email protected]>
1 parent 0785069 commit b8231bf

File tree

6 files changed

+7
-81
lines changed

6 files changed

+7
-81
lines changed

.github/actions/build-push-image/action.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ inputs:
4242
quay_password:
4343
description: The password to access the docker registry
4444
required: false
45-
forked:
46-
description: Flag to checkout source code from forked repository
47-
required: false
48-
default: "false"
4945
tags:
5046
description: A list of tags applied to the image
5147
required: true
@@ -54,18 +50,10 @@ runs:
5450
using: "composite"
5551
steps:
5652
- name: Check out code
57-
if: ${{ inputs.forked == false }}
5853
uses: actions/checkout@v4
5954
with:
6055
submodules: true
6156
fetch-depth: 0
62-
- name: Check out code for forked PR
63-
if: ${{ inputs.forked == true }}
64-
uses: actions/checkout@v4
65-
with:
66-
ref: ${{github.event.pull_request.head.sha}}
67-
repository: ${{github.event.pull_request.head.repo.full_name}}
68-
submodules: true
6957
- name: "Set up Docker Buildx"
7058
uses: docker/setup-buildx-action@v3
7159
with:

.github/workflows/cloud-tests.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: CloudTests
22

33
on:
44
workflow_call:
5-
inputs:
6-
forked:
7-
type: boolean
8-
required: false
9-
default: false
105

116
concurrency:
127
group: cloud-tests-${{ github.ref == 'refs/heads/main' && 'main' || github.actor || github.triggering_actor }}
@@ -30,15 +25,11 @@ jobs:
3025
needs: allowed
3126
uses: ./.github/workflows/test-int.yml
3227
secrets: inherit
33-
with:
34-
forked: ${{ inputs.forked }}
3528

3629
e2e-tests:
3730
needs: allowed
3831
uses: ./.github/workflows/test-e2e.yml
3932
secrets: inherit
40-
with:
41-
forked: ${{ inputs.forked }}
4233

4334
test-e2e-gov:
4435
needs:
@@ -50,5 +41,3 @@ jobs:
5041
needs: allowed
5142
uses: ./.github/workflows/openshift-upgrade-test.yaml
5243
secrets: inherit
53-
with:
54-
forked: ${{ inputs.forked }}

.github/workflows/openshift-upgrade-test.yaml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ on:
1717
default: "quay.io/mongodb"
1818
type: string
1919
required: false
20-
forked:
21-
description: "PR from forked repo"
22-
default: false
23-
type: boolean
24-
required: false
2520
workflow_dispatch:
2621
concurrency:
2722
group: test-openshift-operator-upgrade
@@ -33,18 +28,10 @@ jobs:
3328
runs-on: ubuntu-latest
3429
if: ${{ vars.SKIP_OPENSHIFT != 'true' }}
3530
steps:
36-
- if: ${{ inputs.forked == false }}
37-
name: Check out code
38-
uses: actions/checkout@v4
39-
with:
40-
ref: ${{github.event.pull_request.head.sha}}
41-
fetch-depth: 0 # required for tags
42-
- if: ${{ inputs.forked == true }}
43-
name: Check out code
31+
- name: Check out code
4432
uses: actions/checkout@v4
4533
with:
4634
ref: ${{github.event.pull_request.head.sha}}
47-
repository: ${{github.event.pull_request.head.repo.full_name}}
4835
fetch-depth: 0 # required for tags
4936
- name: Prepare tag
5037
id: prepare

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: E2E tests.
22

33
on:
44
workflow_call:
5-
inputs:
6-
forked:
7-
type: boolean
8-
required: false
9-
default: false
105
workflow_dispatch:
116

127
jobs:
@@ -33,21 +28,12 @@ jobs:
3328
env:
3429
REPOSITORY: ${{ github.repository_owner }}/mongodb-atlas-kubernetes-operator-prerelease
3530
steps:
36-
- if: ${{ inputs.forked == false }}
37-
name: Check out code
31+
- name: Check out code
3832
uses: actions/checkout@v4
3933
with:
4034
ref: ${{github.event.pull_request.head.sha}}
4135
submodules: true
4236
fetch-depth: 0
43-
- if: ${{ inputs.forked == true }}
44-
name: Check out code
45-
uses: actions/checkout@v4
46-
with:
47-
submodules: true
48-
ref: ${{github.event.pull_request.head.sha}}
49-
repository: ${{github.event.pull_request.head.repo.full_name}}
50-
fetch-depth: 0
5137
- name: Prepare tag
5238
id: prepare
5339
uses: ./.github/actions/set-tag
@@ -62,7 +48,6 @@ jobs:
6248
tags: ghcr.io/${{ env.REPOSITORY }}:${{ steps.prepare.outputs.tag }}
6349
platforms: linux/amd64
6450
push_to_docker: false
65-
forked: ${{ inputs.forked }}
6651
- name: Do preflight-check on test image
6752
uses: ./.github/actions/certify-openshift-images
6853
with:
@@ -81,21 +66,12 @@ jobs:
8166
GHCR_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-operator-prerelease
8267
GHCR_BUNDLES_REPO: ghcr.io/mongodb/mongodb-atlas-kubernetes-bundles-prerelease
8368
steps:
84-
- if: ${{ inputs.forked == false }}
85-
name: Check out code
69+
- name: Check out code
8670
uses: actions/checkout@v4
8771
with:
8872
ref: ${{github.event.pull_request.head.sha}}
8973
submodules: true
9074
fetch-depth: 0
91-
- if: ${{ inputs.forked == true }}
92-
name: Check out code
93-
uses: actions/checkout@v4
94-
with:
95-
submodules: true
96-
ref: ${{github.event.pull_request.head.sha}}
97-
repository: ${{github.event.pull_request.head.repo.full_name}}
98-
fetch-depth: 0
9975
- name: Prepare tag
10076
id: prepare
10177
uses: ./.github/actions/set-tag
@@ -132,7 +108,6 @@ jobs:
132108
tags: ${{ env.GHCR_BUNDLES_REPO }}:${{ steps.prepare.outputs.tag }}
133109
platforms: linux/amd64
134110
push_to_docker: false
135-
forked: ${{ inputs.forked }}
136111
e2e:
137112
name: E2E tests
138113
environment: test

.github/workflows/test-int.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@ name: Integration tests.
22

33
on:
44
workflow_call:
5-
inputs:
6-
forked:
7-
type: boolean
8-
required: false
9-
default: false
105
workflow_dispatch:
116

127
jobs:
@@ -26,18 +21,10 @@ jobs:
2621
nodes: 1
2722

2823
steps:
29-
- if: ${{ inputs.forked == false }}
30-
name: Check out code
24+
- name: Check out code
3125
uses: actions/checkout@v4
3226
with:
3327
ref: ${{github.event.pull_request.head.sha}}
34-
35-
- if: ${{ inputs.forked == true }}
36-
name: Check out code
37-
uses: actions/checkout@v4
38-
with:
39-
ref: ${{github.event.pull_request.head.sha}}
40-
repository: ${{github.event.pull_request.head.repo.full_name}}
4128
- name: Install devbox
4229
uses: jetify-com/[email protected]
4330
with:

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
uses: ./.github/workflows/check-licenses.yml
6363

6464
cloud-tests-filter:
65+
if: github.event.pull_request.head.repo.fork == false
6566
needs:
6667
- run-tests
6768
uses: ./.github/workflows/cloud-tests-filter.yml
@@ -73,8 +74,7 @@ jobs:
7374
- validate-manifests
7475
- check-licenses
7576
- cloud-tests-filter
76-
if: (github.event_name == 'merge_group' || needs.cloud-tests-filter.outputs.run-cloud-tests == 'true')
77+
if: |
78+
github.event_name == 'merge_group' || needs.cloud-tests-filter.outputs.run-cloud-tests == 'true'
7779
uses: ./.github/workflows/cloud-tests.yml
7880
secrets: inherit
79-
with:
80-
forked: ${{ github.event.repository.full_name != github.event.pull_request.head.repo.full_name }}

0 commit comments

Comments
 (0)