Skip to content

Commit

Permalink
MRG: Merge pull request #13 from octue/fix/add-missing-return
Browse files Browse the repository at this point in the history
Add missing return statement
  • Loading branch information
cortadocodes authored Dec 19, 2022
2 parents 861f340 + c21bed4 commit 1129a8b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
# Set fetch-depth to 0 to fetch all tags (necessary for git-mkver to determine the correct semantic version).
fetch-depth: 0
- uses: octue/check-semantic-version@1.0.0.beta-8
- uses: octue/check-semantic-version@main
with:
path: pyproject.toml
breaking_change_indicated_by: major
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUN curl -L https://github.com/idc101/git-mkver/releases/download/v1.2.1/git-mkv
| tar xvz \
&& mv git-mkver /usr/local/bin

RUN pip3 install git+https://github.com/octue/[email protected]8
RUN pip3 install git+https://github.com/octue/[email protected]9

COPY check_semantic_version/entrypoint.sh /entrypoint.sh

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ steps:
with:
# Set fetch-depth to 0 to fetch all tags (necessary for `git-mkver` to determine the correct semantic version).
fetch-depth: 0
- uses: octue/[email protected]8
- uses: octue/[email protected]9
with:
path: setup.py
breaking_change_indicated_by: major
Expand Down
2 changes: 1 addition & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ inputs:
default: 'major'
runs:
using: 'docker'
image: 'docker://octue/check-semantic-version:1.0.0.beta-8'
image: 'docker://octue/check-semantic-version:1.0.0.beta-9'
args:
- ${{ inputs.path }}
- ${{ inputs.breaking_change_indicated_by }}
1 change: 1 addition & 0 deletions check_semantic_version/check_semantic_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def check_versions_match(path, breaking_change_indicated_by="major"):
f"{GREEN}VERSION PASSED CHECKS:{NO_COLOUR} The current version is the same as the expected semantic version: "
f"{expected_semantic_version}."
)
return True


def _get_current_version(path, version_source_type):
Expand Down
2 changes: 1 addition & 1 deletion examples/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ jobs:
with:
# Set fetch-depth to 0 to fetch all tags (necessary for git-mkver to determine the correct semantic version).
fetch-depth: 0
- uses: octue/[email protected]8
- uses: octue/[email protected]9
with:
path: setup.py
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "check-semantic-version"
version = "1.0.0.beta-8"
version = "1.0.0.beta-9"
description = "A GitHub action that checks the version of your package is the same as the expected semantic version calculated from the conventional commits on your current branch."
authors = ["Marcus Lugg <[email protected]>"]
readme = "README.md"
Expand Down
12 changes: 6 additions & 6 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def test_cli_with_matching_versions(self):
with self.assertRaises(SystemExit) as e:
cli.main(["setup.py"])

# Check that the exit code is 0.
self.assertFalse(hasattr(e, "exception"))
# Check that the exit code is 0.
self.assertEqual(e.exception.code, 0)

message = mock_stdout.method_calls[0].args[0]
self.assertIn("VERSION PASSED CHECKS:", message)
Expand All @@ -43,8 +43,8 @@ def test_cli_with_non_matching_versions(self):
with self.assertRaises(SystemExit) as e:
cli.main(["setup.py"])

# Check that the exit code is 1.
self.assertEqual(e.exception.code, 1)
# Check that the exit code is 1.
self.assertEqual(e.exception.code, 1)

message = mock_stdout.method_calls[0].args[0]
self.assertIn("VERSION FAILED CHECKS:", message)
Expand All @@ -66,8 +66,8 @@ def test_cli_with_non_matching_versions_reversed(self):
with self.assertRaises(SystemExit) as e:
cli.main(["setup.py"])

# Check that the exit code is 1.
self.assertEqual(e.exception.code, 1)
# Check that the exit code is 1.
self.assertEqual(e.exception.code, 1)

message = mock_stdout.method_calls[0].args[0]
self.assertIn("VERSION FAILED CHECKS:", message)
Expand Down

0 comments on commit 1129a8b

Please sign in to comment.