Skip to content

Commit 3f39b0b

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f7c6dd2 commit 3f39b0b

File tree

1 file changed

+4
-2
lines changed
  • packit_service/worker/checker

1 file changed

+4
-2
lines changed

packit_service/worker/checker/copr.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,25 @@ def _pre_check(self) -> bool:
143143
return False
144144
return True
145145

146+
146147
class AreFilesChanged(Checker, GetCoprBuildJobHelperForIdMixin):
147148
"""
148149
Check if any files under the current package's `paths` field is changed.
149150
If not, then just skip the current copr build job.
150151
"""
152+
151153
def get_previous_git_ref(self) -> Optional[str]:
152154
"""
153155
Get the previous git ref if any.
154156
"""
155157
if self.job_config.trigger == JobConfigTriggerType.pull_request:
156158
# For PRs return the target branch
157159
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:
159161
# For branch commits return the effective `HEAD^` commit
160162
current_commit = self.copr_build_helper.metadata.commit_sha
161163
return f"{current_commit}^"
162-
elif self.job_config.trigger == JobConfigTriggerType.release:
164+
if self.job_config.trigger == JobConfigTriggerType.release:
163165
# For releases we don't do any checks
164166
return None
165167

0 commit comments

Comments
 (0)