File tree 1 file changed +4
-2
lines changed
packit_service/worker/checker
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -143,23 +143,25 @@ def _pre_check(self) -> bool:
143
143
return False
144
144
return True
145
145
146
+
146
147
class AreFilesChanged (Checker , GetCoprBuildJobHelperForIdMixin ):
147
148
"""
148
149
Check if any files under the current package's `paths` field is changed.
149
150
If not, then just skip the current copr build job.
150
151
"""
152
+
151
153
def get_previous_git_ref (self ) -> Optional [str ]:
152
154
"""
153
155
Get the previous git ref if any.
154
156
"""
155
157
if self .job_config .trigger == JobConfigTriggerType .pull_request :
156
158
# For PRs return the target branch
157
159
return self .copr_build_helper .pull_request_object .target_branch
158
- elif self .job_config .trigger == JobConfigTriggerType .commit :
160
+ if self .job_config .trigger == JobConfigTriggerType .commit :
159
161
# For branch commits return the effective `HEAD^` commit
160
162
current_commit = self .copr_build_helper .metadata .commit_sha
161
163
return f"{ current_commit } ^"
162
- elif self .job_config .trigger == JobConfigTriggerType .release :
164
+ if self .job_config .trigger == JobConfigTriggerType .release :
163
165
# For releases we don't do any checks
164
166
return None
165
167
You can’t perform that action at this time.
0 commit comments