mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
Improve handling of first CI run for new branch. (#29070)
This commit is contained in:
parent
fe3b4325c2
commit
a1453a7917
2 changed files with 9 additions and 3 deletions
|
@ -74,8 +74,8 @@ class ShippableChanges(object):
|
|||
self.paths = sorted(git.get_diff_names([last_successful_commit, self.commit]))
|
||||
self.diff = git.get_diff([last_successful_commit, self.commit])
|
||||
else:
|
||||
# tracked files (including unchanged)
|
||||
self.paths = sorted(git.get_file_names(['--cached']))
|
||||
# first run for branch
|
||||
self.paths = None # act as though change detection not enabled, do not filter targets
|
||||
self.diff = []
|
||||
|
||||
def get_merge_runs(self, project_id, branch):
|
||||
|
@ -117,6 +117,9 @@ class ShippableChanges(object):
|
|||
if git.is_valid_ref(commit_sha):
|
||||
last_successful_commit = commit_sha
|
||||
|
||||
if last_successful_commit is None:
|
||||
display.warning('No successful commit found. All tests will be executed.')
|
||||
|
||||
return last_successful_commit
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue