Skip to content

Commit

Permalink
Merge pull request #99 from HebaruSan/feature/empty-diff-skip-inst
Browse files Browse the repository at this point in the history
Skip install step when metadata is unchanged
  • Loading branch information
HebaruSan authored Nov 27, 2024
2 parents 697ec2c + f586186 commit d0eab53
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:

## See also

Validate your KSP-AVC .version files with https://github.com/DasSkelett/AVC-VersionFileValidator !
Validate your KSP-AVC .version files with <https://github.com/DasSkelett/AVC-VersionFileValidator>!

## Contributions

Expand Down
4 changes: 4 additions & 0 deletions ckan_meta_tester/ckan_meta_tester.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def install_ckan(self, file: Path, orig_file: Path, pr_body: Optional[str], meta
if meta_repo is not None:
diff = ckan.find_diff(meta_repo)
if diff is not None:
if len(diff) == 0:
print(f'::notice file={orig_file}::Diff empty for {ckan.name} {ckan.version}, skipping install',
flush=True)
return True
with LogGroup(f'Diffing {ckan.name} {ckan.version}'):
print(diff, end='', flush=True)
with LogGroup(f'Installing {ckan.name} {ckan.version}'):
Expand Down
3 changes: 1 addition & 2 deletions tests/dummy_game_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import unittest.util
from unittest import TestCase
from unittest.mock import Mock, patch, call
from tempfile import TemporaryDirectory, TemporaryFile

from ckan_meta_tester.game import Game
from ckan_meta_tester.game_version import GameVersion
Expand All @@ -26,7 +25,7 @@ def test_dummy_game_instance_calls(self,
mocked_run: Mock) -> None:

# Arrange
unittest.util._MAX_LENGTH=999999999 # :snake:
unittest.util._MAX_LENGTH=999999999 # type: ignore # pylint: disable=protected-access

# Act
with DummyGameInstance(
Expand Down

0 comments on commit d0eab53

Please sign in to comment.