14
14
# It guarantees that the workflow logic is not altered by the PR.
15
15
pull_request_target :
16
16
types : [opened, synchronize]
17
- # We only accept PRs touching connectors
18
- paths :
19
- - " airbyte-integrations/connectors/**"
20
- branches :
21
- - " master"
22
17
23
18
jobs :
19
+ fail_on_protected_path_changes :
20
+ name : " Check fork do not change protected paths"
21
+ if : github.event.pull_request.head.repo.fork == true
22
+ runs-on : ubuntu-latest
23
+ permissions :
24
+ pull-requests : read
25
+ steps :
26
+ - name : Check for changes in protected paths
27
+ id : check_for_changes_in_protected_paths
28
+ uses : dorny/paths-filter@v2
29
+ with :
30
+ filters : |
31
+ protected_paths:
32
+ - '.github/**'
33
+ - 'airbyte-ci/**'
34
+
35
+ - name : Fail if changes in protected paths
36
+ if : steps.check_for_changes_in_protected_paths.outputs.protected_paths == 'true'
37
+ run : |
38
+ echo "The fork has changes in protected paths. This is not allowed."
39
+ exit 1
40
+
24
41
format_check :
25
42
# IMPORTANT: This name must match the require check name on the branch protection settings
26
43
name : " Check for formatting errors"
27
44
if : github.event.pull_request.head.repo.fork == true
28
45
environment : community-ci-auto
29
46
runs-on : community-tooling-test-small
47
+ needs : fail_on_protected_path_changes
30
48
timeout-minutes : 30
31
49
env :
32
50
MAIN_BRANCH_NAME : " master"
41
59
fetch-depth : 1
42
60
43
61
# This will sync the .github folder of the main repo with the fork
44
- # This allows us to use up to date actions from the main repo
62
+ # This allows us to use up to date actions and CI logic from the main repo
45
63
- name : Pull .github folder and internal packages from main repository
46
64
id : pull_github_folder
47
65
run : |
62
80
connectors_early_ci :
63
81
name : Run connectors early CI on fork
64
82
if : github.event.pull_request.head.repo.fork == true
83
+ needs : fail_on_protected_path_changes
65
84
environment : community-ci-auto
66
85
runs-on : community-tooling-test-small
67
86
timeout-minutes : 10
80
99
fetch-depth : 1
81
100
82
101
# This will sync the .github folder of the main repo with the fork
83
- # This allows us to use up to date actions and internal packages logic from the main repo
84
- # It will also prevent forks from changing CI logic
102
+ # This allows us to use up to date actions and CI logic from the main repo
85
103
- name : Pull .github folder from main repository
86
104
id : pull_github_folder
87
105
run : |
@@ -114,12 +132,13 @@ jobs:
114
132
retention-days : 7
115
133
116
134
connectors_full_ci :
117
- name : Run all connectors tests on fork
135
+ name : Run connectors full CI on fork
118
136
if : github.event.pull_request.head.repo.fork == true
119
137
# Deployment of jobs on the community-ci environment requires manual approval
120
138
# This is something we set up in the GitHub environment settings:
121
139
# https://github.com/airbytehq/airbyte/settings/environments/2091483613/edit
122
140
# This is a safety measure to make sure the code running on our infrastructure has been reviewed before running on it
141
+ needs : fail_on_protected_path_changes
123
142
environment : community-ci
124
143
runs-on : community-connector-test-large
125
144
timeout-minutes : 180 # 3 hours
@@ -138,9 +157,8 @@ jobs:
138
157
ref : ${{ github.event.pull_request.head.sha }}
139
158
fetch-depth : 1
140
159
141
- # This will sync the .github folder of the main repo with the fork
142
- # This allows us to use up to date actions and internal packages logic from the main repo
143
- # It will also prevent forks from changing CI logic - name: Pull .github folder from main repository
160
+ # This will sync the .github folder of the main repo with the fork
161
+ # This allows us to use up to date actions and CI logic from the main repo
144
162
- name : Pull .github folder from main repository
145
163
id : pull_github_folder
146
164
run : |
0 commit comments