From b49708a89c88e01ef4d83d940adbbd4db0147d23 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 15:45:42 +0200 Subject: [PATCH 1/9] docs: Use default values in example --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index edcd164..7f6870d 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,12 @@ for [Conventional Commits](https://www.conventionalcommits.org/) with support fo id: get-release-version with: prefix: "v" - suffix: "beta" - reference-version-suffix: "dev" + suffix: "NONE" + reference-version-suffix: "NONE" bumping-suffix: "hotfix" - only-bump-suffix: "true" + only-bump-suffix: "false" create-tag: "true" + mode: "semantic" - run: echo ${{ steps.get-release-version.outputs.version }} - run: echo ${{ steps.get-release-version.outputs.version-name }} From 15b56f79d510d576d1db8b82bc3d93cdd610ed79 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:16:17 +0200 Subject: [PATCH 2/9] feat: inputs for git username and email --- .github/actions/local-action/action.yaml | 12 ++++++++++++ action.yaml | 16 ++++++++++++++-- get_release_version_action/algorithms/cli.py | 16 ++++++++++++++++ .../algorithms/main_algorithm.py | 9 +++++++++ get_release_version_action/models/inputs.py | 6 ++++++ get_release_version_action/utils/git.py | 6 +++++- 6 files changed, 62 insertions(+), 3 deletions(-) diff --git a/.github/actions/local-action/action.yaml b/.github/actions/local-action/action.yaml index 5adaf5d..82e28c0 100644 --- a/.github/actions/local-action/action.yaml +++ b/.github/actions/local-action/action.yaml @@ -26,6 +26,14 @@ inputs: description: "Create a Git Tag for the version and push it if a remote is configured." required: false default: "true" + git-username: + description: "The username for creating the (annotated) git tag. Use `NONE` for no username." + required: false + default: "NONE" + git-email: + description: "The email address for creating the (annotated) git tag. Use `NONE` for no email address." + required: false + default: "NONE" mode: description: "The mode to use for determining the next version. Possible values: `semantic`, `hash-based`." required: false @@ -57,5 +65,9 @@ runs: - ${{ inputs.only-bump-suffix }} - --create-tag - ${{ inputs.create-tag }} + - --git-username + - ${{ inputs.git-username }} + - --git-email + - ${{ inputs.git-email }} - --mode - ${{ inputs.mode }} diff --git a/action.yaml b/action.yaml index 9ea768f..3849017 100644 --- a/action.yaml +++ b/action.yaml @@ -7,11 +7,11 @@ inputs: required: false default: "v" suffix: - description: "The suffix that should appended to the version." + description: "The suffix that should appended to the version. Use `NONE` for no suffix." required: false default: "NONE" reference-version-suffix: - description: "The suffix that should be replaced with the value in `suffix`." + description: "The suffix that should be replaced with the value in `suffix`. Use `NONE` for no suffix." required: false default: "NONE" bumping-suffix: @@ -26,6 +26,14 @@ inputs: description: "Create a Git Tag for the version and push it if a remote is configured." required: false default: "true" + git-username: + description: "The username for creating the (annotated) git tag. Use `NONE` for no username." + required: false + default: "NONE" + git-email: + description: "The email address for creating the (annotated) git tag. Use `NONE` for no email address." + required: false + default: "NONE" mode: description: "The mode to use for determining the next version. Possible values: `semantic`, `hash-based`." required: false @@ -57,5 +65,9 @@ runs: - ${{ inputs.only-bump-suffix }} - --create-tag - ${{ inputs.create-tag }} + - --git-username + - ${{ inputs.git-username }} + - --git-email + - ${{ inputs.git-email }} - --mode - ${{ inputs.mode }} diff --git a/get_release_version_action/algorithms/cli.py b/get_release_version_action/algorithms/cli.py index 71bdff9..46c7926 100644 --- a/get_release_version_action/algorithms/cli.py +++ b/get_release_version_action/algorithms/cli.py @@ -76,6 +76,22 @@ def cli_entrypoint() -> None: help='Create a git tag for the version and push it if a remote is configured.' ) + parser.add_argument( + '--git-username', + dest='git_username', + required=False, + default='NONE', + help='The username for creating the (annotated) git tag. Use `NONE` for no username.' + ) + + parser.add_argument( + '--git-email', + dest='git_email', + required=False, + default='NONE', + help='The email address for creating the (annotated) git tag. Use `NONE` for no email address.' + ) + parser.add_argument( '--mode', dest='mode', diff --git a/get_release_version_action/algorithms/main_algorithm.py b/get_release_version_action/algorithms/main_algorithm.py index 0096dcc..688d519 100644 --- a/get_release_version_action/algorithms/main_algorithm.py +++ b/get_release_version_action/algorithms/main_algorithm.py @@ -16,9 +16,18 @@ logger = logging.getLogger('wemogy.get-release-version-action') +def check_inputs(inputs: Inputs): + """Check if the input is valid.""" + # If create_tag is true, a git email address and a username are required. + if inputs.create_tag: + if inputs.git_email is None or inputs.git_username is None: + raise ValueError('git email and username are required when a tag should be created!') + + def main_algorithm(inputs: Inputs) -> Outputs: """The main algorithm.""" logger.debug('Inputs: %s', inputs) + check_inputs(inputs) with git.Repo(os.getcwd()) as repo: if inputs.mode == 'semantic': diff --git a/get_release_version_action/models/inputs.py b/get_release_version_action/models/inputs.py index 24178ee..3be1390 100644 --- a/get_release_version_action/models/inputs.py +++ b/get_release_version_action/models/inputs.py @@ -37,6 +37,12 @@ class Inputs: create_tag: bool = True """Create a git tag for the version and push it if a remote is configured.""" + git_username: str | None = None + """The username for creating the (annotated) git tag. Use `NONE` for no username.""" + + git_email: str | None = None + """The email address for creating the (annotated) git tag. Use `NONE` for no email address.""" + mode: str = 'semantic' """The mode to use for determining the next version. Possible values: `semantic`, `hash-based`.""" diff --git a/get_release_version_action/utils/git.py b/get_release_version_action/utils/git.py index e766151..08cf03a 100644 --- a/get_release_version_action/utils/git.py +++ b/get_release_version_action/utils/git.py @@ -16,8 +16,12 @@ tag_creation_history: list[str] = [] -def create_git_tag(version: str) -> None: +def create_git_tag(version: str, username: str, email: str) -> None: """Create a new git tag for the given version and push it if a remote is configured.""" + logger.info('Setting git username and email to %s <%s>', username, email) + run_command('git', 'config', 'user.email', email) + run_command('git', 'config', 'user.name', username) + logger.info('Creating tag %s', version) # Create the tag From aac25e8e6681aab400e7928b5f7b07c77ad06015 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:16:54 +0200 Subject: [PATCH 3/9] docs: inputs for git username and email --- README.md | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 7f6870d..8c948d7 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,6 @@ for [Conventional Commits](https://www.conventionalcommits.org/) with support fo with: fetch-depth: 0 -- name: Setup git for annotated tags - run: | - git config user.email "your@email.com" - git config user.name "Your username" - - uses: wemogy/get-release-version-action@v4.2.2 id: get-release-version with: @@ -25,6 +20,8 @@ for [Conventional Commits](https://www.conventionalcommits.org/) with support fo bumping-suffix: "hotfix" only-bump-suffix: "false" create-tag: "true" + git-username: "Your User" + git-email: "you@example.com" mode: "semantic" - run: echo ${{ steps.get-release-version.outputs.version }} @@ -36,20 +33,22 @@ for [Conventional Commits](https://www.conventionalcommits.org/) with support fo ### Inputs -| Input | Required | Default | Description | -| -------------------------- | -------- | ---------- | -------------------------------------------------------------------------------------------------------- | -| `prefix` | `false` | `v` | The prefix that should be prepended to the version. | -| `suffix` | `false` | `NONE` | The suffix that should be appended to the version (e.g. `beta`). Use `NONE` for no suffix. | -| `reference-version-suffix` | `false` | `NONE` | The suffix that should be replaced with the value in `suffix` (e.g. `dev`). Use `NONE` for no suffix. | -| `bumping-suffix` | `false` | `hotfix` | The suffix to append to the version (or increment if it already exists) if `only-bump-suffix` is `true`. | -| `only-bump-suffix` | `false` | `false` | Bump the `bumping-suffix` instead of the version if changes were detected. | -| `create-tag` | `false` | `true` | Create a git tag for the version and push it if a remote is configured. | -| `mode` | `false` | `semantic` | The mode to use for determining the next version. Possible values: `semantic`, `hash-based`. | +| Input | Required | Default | Description | +|----------------------------|---------------------------|------------|----------------------------------------------------------------------------------------------------------| +| `prefix` | `false` | `v` | The prefix that should be prepended to the version. | +| `suffix` | `false` | `NONE` | The suffix that should be appended to the version (e.g. `beta`). Use `NONE` for no suffix. | +| `reference-version-suffix` | `false` | `NONE` | The suffix that should be replaced with the value in `suffix` (e.g. `dev`). Use `NONE` for no suffix. | +| `bumping-suffix` | `false` | `hotfix` | The suffix to append to the version (or increment if it already exists) if `only-bump-suffix` is `true`. | +| `only-bump-suffix` | `false` | `false` | Bump the `bumping-suffix` instead of the version if changes were detected. | +| `create-tag` | `false` | `true` | Create a git tag for the version and push it if a remote is configured. | +| `git-username` | If `create-tag` is `true` | `NONE` | The username for creating the (annotated) git tag. Use `NONE` for no username. | +| `git-email` | If `create-tag` is `true` | `NONE` | The email address for creating the (annotated) git tag. Use `NONE` for no email address. | +| `mode` | `false` | `semantic` | The mode to use for determining the next version. Possible values: `semantic`, `hash-based`. | ### Outputs | Output | Description | -| ----------------------- | ----------------------------------------------------------- | +|-------------------------|-------------------------------------------------------------| | `version` | The next version, without the prefix. | | `version-name` | The next version, with the prefix. | | `previous-version` | The previous version, without the prefix. | From 5d609985bf1e22501d08d27db4143cd706cc554a Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:17:07 +0200 Subject: [PATCH 4/9] test: Update tests --- tests/e2e/test_one_commit.py | 30 ++++ tests/e2e/test_one_hotfix.py | 36 ++++ tests/e2e/test_one_hotfix_then_version.py | 54 ++++++ tests/e2e/test_two_commits.py | 96 +++++++++++ tests/e2e/test_two_hotfixes.py | 54 ++++++ tests/e2e/test_two_versions.py | 192 ++++++++++++++++++++++ 6 files changed, 462 insertions(+) diff --git a/tests/e2e/test_one_commit.py b/tests/e2e/test_one_commit.py index 85d286f..1881194 100644 --- a/tests/e2e/test_one_commit.py +++ b/tests/e2e/test_one_commit.py @@ -9,6 +9,8 @@ def test_initial(repo: TestRepo) -> None: """Test Case: Run the action directly after the initial commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -24,6 +26,8 @@ def test_initial(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -40,6 +44,8 @@ def test_initial(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -83,6 +89,8 @@ def test_chore(repo: TestRepo) -> None: """Test Case: Run the action after a ``chore:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -98,6 +106,8 @@ def test_chore(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -114,6 +124,8 @@ def test_chore(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -159,6 +171,8 @@ def test_fix(repo: TestRepo) -> None: """Test Case: Run the action after a ``fix:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -174,6 +188,8 @@ def test_fix(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -190,6 +206,8 @@ def test_fix(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -235,6 +253,8 @@ def test_feat(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -250,6 +270,8 @@ def test_feat(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -266,6 +288,8 @@ def test_feat(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -311,6 +335,8 @@ def test_breaking(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat!:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -326,6 +352,8 @@ def test_breaking(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -342,6 +370,8 @@ def test_breaking(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, diff --git a/tests/e2e/test_one_hotfix.py b/tests/e2e/test_one_hotfix.py index 1ee9bfd..e473589 100644 --- a/tests/e2e/test_one_hotfix.py +++ b/tests/e2e/test_one_hotfix.py @@ -10,6 +10,8 @@ def test_fix_then_hotfix(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -25,6 +27,8 @@ def test_fix_then_hotfix(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -41,6 +45,8 @@ def test_fix_then_hotfix(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -58,6 +64,8 @@ def test_fix_then_hotfix(repo: TestRepo) -> None: # Hotfix args_hotfix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -75,6 +83,8 @@ def test_fix_then_hotfix(repo: TestRepo) -> None: ) args_hotfix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -92,6 +102,8 @@ def test_fix_then_hotfix(repo: TestRepo) -> None: ) args_hotfix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -167,6 +179,8 @@ def test_feature_then_hotfix(repo: TestRepo) -> None: # Arrange # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -182,6 +196,8 @@ def test_feature_then_hotfix(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -198,6 +214,8 @@ def test_feature_then_hotfix(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -215,6 +233,8 @@ def test_feature_then_hotfix(repo: TestRepo) -> None: # Hotfix args_hotfix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -232,6 +252,8 @@ def test_feature_then_hotfix(repo: TestRepo) -> None: ) args_hotfix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -249,6 +271,8 @@ def test_feature_then_hotfix(repo: TestRepo) -> None: ) args_hotfix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -324,6 +348,8 @@ def test_breaking_then_hotfix(repo: TestRepo) -> None: # Arrange # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -339,6 +365,8 @@ def test_breaking_then_hotfix(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -355,6 +383,8 @@ def test_breaking_then_hotfix(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -372,6 +402,8 @@ def test_breaking_then_hotfix(repo: TestRepo) -> None: # Hotfix args_hotfix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -389,6 +421,8 @@ def test_breaking_then_hotfix(repo: TestRepo) -> None: ) args_hotfix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -406,6 +440,8 @@ def test_breaking_then_hotfix(repo: TestRepo) -> None: ) args_hotfix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', diff --git a/tests/e2e/test_one_hotfix_then_version.py b/tests/e2e/test_one_hotfix_then_version.py index 0661426..58bcf91 100644 --- a/tests/e2e/test_one_hotfix_then_version.py +++ b/tests/e2e/test_one_hotfix_then_version.py @@ -10,6 +10,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: # Arrange # Fix 1 args_fix1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -25,6 +27,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: ) args_fix1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -41,6 +45,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: ) args_fix1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -58,6 +64,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: # Hotfix args_hotfix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -75,6 +83,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: ) args_hotfix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -92,6 +102,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: ) args_hotfix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -110,6 +122,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: # Fix 2 args_fix2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -125,6 +139,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: ) args_fix2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -141,6 +157,8 @@ def test_fix_then_hotfix_then_fix(repo: TestRepo) -> None: ) args_fix2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -241,6 +259,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -256,6 +276,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -272,6 +294,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -289,6 +313,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: # Hotfix args_hotfix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -306,6 +332,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: ) args_hotfix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -323,6 +351,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: ) args_hotfix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -341,6 +371,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: # Feature args_feature_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -356,6 +388,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: ) args_feature_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -372,6 +406,8 @@ def test_fix_then_hotfix_then_feature(repo: TestRepo) -> None: ) args_feature_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -472,6 +508,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -487,6 +525,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -503,6 +543,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -520,6 +562,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: # Hotfix args_hotfix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -537,6 +581,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: ) args_hotfix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -554,6 +600,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: ) args_hotfix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -572,6 +620,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -587,6 +637,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -603,6 +655,8 @@ def test_fix_then_hotfix_then_breaking(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, diff --git a/tests/e2e/test_two_commits.py b/tests/e2e/test_two_commits.py index e1571e9..4853eb1 100644 --- a/tests/e2e/test_two_commits.py +++ b/tests/e2e/test_two_commits.py @@ -10,6 +10,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: """Test Case: Run the action after a ``chore:`` and another ``chore:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -25,6 +27,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -41,6 +45,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -87,6 +93,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: """Test Case: Run the action after a ``chore:`` and a ``fix:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -102,6 +110,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -118,6 +128,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -164,6 +176,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: """Test Case: Run the action after a ``chore:`` and a ``feat:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -179,6 +193,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -195,6 +211,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -241,6 +259,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: """Test Case: Run the action after a ``chore:`` and a ``feat!:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -256,6 +276,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -272,6 +294,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -318,6 +342,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: """Test Case: Run the action after a ``fix:`` and a ``chore:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -333,6 +359,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -349,6 +377,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -395,6 +425,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: """Test Case: Run the action after a ``fix:`` and another ``fix:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -410,6 +442,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -426,6 +460,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -472,6 +508,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: """Test Case: Run the action after a ``fix:`` and a ``feat:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -486,6 +524,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -502,6 +542,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -548,6 +590,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: """Test Case: Run the action after a ``fix:`` and a ``feat!:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -563,6 +607,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -579,6 +625,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -625,6 +673,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat:`` and a ``chore:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -640,6 +690,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -656,6 +708,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -702,6 +756,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat:`` and a ``fix:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -717,6 +773,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -733,6 +791,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -779,6 +839,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat:`` and another ``feat:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -793,6 +855,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -809,6 +873,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -855,6 +921,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat:`` and a ``feat!:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -870,6 +938,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -886,6 +956,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -932,6 +1004,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat!:`` and a ``chore:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -947,6 +1021,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -963,6 +1039,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1009,6 +1087,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat!:`` and a ``fix:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1024,6 +1104,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1040,6 +1122,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1086,6 +1170,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat!:`` and another ``feat:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1100,6 +1186,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1116,6 +1204,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1162,6 +1252,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: """Test Case: Run the action after a ``feat!:`` and another ``feat!:`` commit.""" # Arrange args_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1177,6 +1269,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: ) args_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1193,6 +1287,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: ) args_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, diff --git a/tests/e2e/test_two_hotfixes.py b/tests/e2e/test_two_hotfixes.py index a38f99e..dda8577 100644 --- a/tests/e2e/test_two_hotfixes.py +++ b/tests/e2e/test_two_hotfixes.py @@ -10,6 +10,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -25,6 +27,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -41,6 +45,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -58,6 +64,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: # Hotfix 1 args_hotfix1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -75,6 +83,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -92,6 +102,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -110,6 +122,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: # Hotfix 2 args_hotfix2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -127,6 +141,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -144,6 +160,8 @@ def test_fix_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -245,6 +263,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: # Arrange # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -260,6 +280,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -276,6 +298,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -293,6 +317,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: # Hotfix 1 args_hotfix1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -310,6 +336,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -327,6 +355,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -345,6 +375,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: # Hotfix 2 args_hotfix2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -362,6 +394,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -379,6 +413,8 @@ def test_feat_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -480,6 +516,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: # Arrange # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -495,6 +533,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -511,6 +551,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -528,6 +570,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: # Hotfix 1 args_hotfix1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -545,6 +589,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -562,6 +608,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', @@ -580,6 +628,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: # Hotfix 2 args_hotfix2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -597,6 +647,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', reference_version_suffix='pre', @@ -614,6 +666,8 @@ def test_breaking_then_hotfixes(repo: TestRepo) -> None: ) args_hotfix2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, reference_version_suffix='beta', diff --git a/tests/e2e/test_two_versions.py b/tests/e2e/test_two_versions.py index 7497365..eabfdb3 100644 --- a/tests/e2e/test_two_versions.py +++ b/tests/e2e/test_two_versions.py @@ -10,6 +10,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: # Arrange # Chore 1 args_chore1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -25,6 +27,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: ) args_chore1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -41,6 +45,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: ) args_chore1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -58,6 +64,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: # Chore 2 args_chore2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -73,6 +81,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: ) args_chore2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -89,6 +99,8 @@ def test_chore_then_chore(repo: TestRepo) -> None: ) args_chore2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -162,6 +174,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: # Arrange # Chore args_chore_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -177,6 +191,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: ) args_chore_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -193,6 +209,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: ) args_chore_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -210,6 +228,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -225,6 +245,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -241,6 +263,8 @@ def test_chore_then_fix(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -315,6 +339,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: # Arrange # Chore args_chore_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -330,6 +356,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: ) args_chore_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -346,6 +374,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: ) args_chore_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -363,6 +393,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -378,6 +410,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -394,6 +428,8 @@ def test_chore_then_feat(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -468,6 +504,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: # Arrange # Chore args_chore_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -483,6 +521,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: ) args_chore_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -499,6 +539,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: ) args_chore_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -516,6 +558,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -531,6 +575,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -547,6 +593,8 @@ def test_chore_then_breaking(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -621,6 +669,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -636,6 +686,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -652,6 +704,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -669,6 +723,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: # Chore args_chore_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -684,6 +740,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: ) args_chore_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -700,6 +758,8 @@ def test_fix_then_chore(repo: TestRepo) -> None: ) args_chore_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -774,6 +834,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: # Arrange # Fix 1 args_fix1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -789,6 +851,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: ) args_fix1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -805,6 +869,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: ) args_fix1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -822,6 +888,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: # Fix 2 args_fix2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -837,6 +905,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: ) args_fix2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -853,6 +923,8 @@ def test_fix_then_fix(repo: TestRepo) -> None: ) args_fix2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -927,6 +999,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -942,6 +1016,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -958,6 +1034,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -975,6 +1053,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -990,6 +1070,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1006,6 +1088,8 @@ def test_fix_then_feat(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1080,6 +1164,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: # Arrange # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1095,6 +1181,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1111,6 +1199,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1128,6 +1218,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1143,6 +1235,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1159,6 +1253,8 @@ def test_fix_then_breaking(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1233,6 +1329,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: # Arrange # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1248,6 +1346,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1264,6 +1364,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1281,6 +1383,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: # Chore args_chore_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1296,6 +1400,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: ) args_chore_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1312,6 +1418,8 @@ def test_feat_then_chore(repo: TestRepo) -> None: ) args_chore_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1386,6 +1494,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: # Arrange # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1401,6 +1511,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1417,6 +1529,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1434,6 +1548,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1449,6 +1565,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1465,6 +1583,8 @@ def test_feat_then_fix(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1539,6 +1659,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: # Arrange # Feature 1 args_feat1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1554,6 +1676,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: ) args_feat1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1570,6 +1694,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: ) args_feat1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1587,6 +1713,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: # Feature 2 args_feat2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1602,6 +1730,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: ) args_feat2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1618,6 +1748,8 @@ def test_feat_then_feat(repo: TestRepo) -> None: ) args_feat2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1692,6 +1824,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: # Arrange # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1707,6 +1841,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1723,6 +1859,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1740,6 +1878,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1755,6 +1895,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1771,6 +1913,8 @@ def test_feat_then_breaking(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1845,6 +1989,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: # Arrange # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1860,6 +2006,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1876,6 +2024,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1893,6 +2043,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: # Chore args_chore_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -1908,6 +2060,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: ) args_chore_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -1924,6 +2078,8 @@ def test_breaking_then_chore(repo: TestRepo) -> None: ) args_chore_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -1998,6 +2154,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: # Arrange # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -2013,6 +2171,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -2029,6 +2189,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -2046,6 +2208,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: # Fix args_fix_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -2061,6 +2225,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: ) args_fix_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -2077,6 +2243,8 @@ def test_breaking_then_fix(repo: TestRepo) -> None: ) args_fix_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -2151,6 +2319,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: # Arrange # Breaking args_breaking_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -2166,6 +2336,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: ) args_breaking_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -2182,6 +2354,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: ) args_breaking_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -2199,6 +2373,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: # Feature args_feat_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -2214,6 +2390,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: ) args_feat_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -2230,6 +2408,8 @@ def test_breaking_then_feat(repo: TestRepo) -> None: ) args_feat_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -2304,6 +2484,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: # Arrange # Breaking 1 args_breaking1_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -2319,6 +2501,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: ) args_breaking1_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -2335,6 +2519,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: ) args_breaking1_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, @@ -2352,6 +2538,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: # Breaking 2 args_breaking2_release = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='pre', reference_version_suffix=None, @@ -2367,6 +2555,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: ) args_breaking2_beta = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix='beta', only_bump_suffix=True, @@ -2383,6 +2573,8 @@ def test_breaking_then_breaking(repo: TestRepo) -> None: ) args_breaking2_prod = ActionInputs( + git_username='wemogy IT', + git_email='it@wemogy.com', prefix='v', suffix=None, only_bump_suffix=True, From ccf1351faf070eb0553c5ab0b79de91f7fada014 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:19:02 +0200 Subject: [PATCH 5/9] ci: Update workflows --- .github/workflows/release.yaml | 7 ++----- .github/workflows/test.yaml | 5 ----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 8937b2e..9be459f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -15,16 +15,13 @@ jobs: with: fetch-depth: 0 - - name: Setup git - run: | - git config user.email "it@wemogy.com" - git config user.name "wemogy IT" - - name: Get version for next release id: get-release-version uses: ./.github/actions/local-action with: create-tag: "true" + git-username: "wemogy IT" + git-email: "it@wemogy.com" - name: Build Containers uses: ./.github/actions/containers diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fdc0550..dc0d905 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -39,11 +39,6 @@ jobs: - name: Setup Python uses: ./.github/actions/setup-python - - name: Setup git - run: | - git config --global user.email "it@wemogy.com" - git config --global user.name "Wemogy IT" - - name: Run pytest run: poetry run pytest --junit-xml test-result.xml tests/e2e From 0230e1bd1f74578df12fee12f66d97e3178c3e84 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:22:39 +0200 Subject: [PATCH 6/9] chore: Fix errors --- get_release_version_action/algorithms/main_algorithm.py | 4 ++-- pyproject.toml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/get_release_version_action/algorithms/main_algorithm.py b/get_release_version_action/algorithms/main_algorithm.py index 688d519..8250b7d 100644 --- a/get_release_version_action/algorithms/main_algorithm.py +++ b/get_release_version_action/algorithms/main_algorithm.py @@ -16,7 +16,7 @@ logger = logging.getLogger('wemogy.get-release-version-action') -def check_inputs(inputs: Inputs): +def check_inputs(inputs: Inputs) -> None: """Check if the input is valid.""" # If create_tag is true, a git email address and a username are required. if inputs.create_tag: @@ -50,7 +50,7 @@ def main_algorithm(inputs: Inputs) -> Outputs: ('0.0.0' not in new_version_tag_name and previous_version_tag_name != new_version_tag_name)) if inputs.create_tag and new_tag_needed: - create_git_tag(new_version_tag_name) + create_git_tag(new_version_tag_name, inputs.git_username, inputs.git_email) output = Outputs( version=new_version, diff --git a/pyproject.toml b/pyproject.toml index 0059314..6a8bd17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,8 @@ max-line-length = 120 [tool.pylint.message-control] disable = [ - "too-many-return-statements" + "too-many-return-statements", + "too-many-instance-attributes" ] [tool.flake8] From 316643af027d214f069539927d528ab198632c0e Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:24:26 +0200 Subject: [PATCH 7/9] chore: Fix typing error --- get_release_version_action/utils/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/get_release_version_action/utils/git.py b/get_release_version_action/utils/git.py index 08cf03a..26ad2ab 100644 --- a/get_release_version_action/utils/git.py +++ b/get_release_version_action/utils/git.py @@ -16,7 +16,7 @@ tag_creation_history: list[str] = [] -def create_git_tag(version: str, username: str, email: str) -> None: +def create_git_tag(version: str, username: str | None, email: str | None) -> None: """Create a new git tag for the given version and push it if a remote is configured.""" logger.info('Setting git username and email to %s <%s>', username, email) run_command('git', 'config', 'user.email', email) From 65a71488fff637e99d880a6f249b5a02fab375c8 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:25:53 +0200 Subject: [PATCH 8/9] chore: Fix typing --- .../algorithms/main_algorithm.py | 12 ++++-------- get_release_version_action/utils/git.py | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/get_release_version_action/algorithms/main_algorithm.py b/get_release_version_action/algorithms/main_algorithm.py index 8250b7d..88b81d5 100644 --- a/get_release_version_action/algorithms/main_algorithm.py +++ b/get_release_version_action/algorithms/main_algorithm.py @@ -16,19 +16,15 @@ logger = logging.getLogger('wemogy.get-release-version-action') -def check_inputs(inputs: Inputs) -> None: - """Check if the input is valid.""" +def main_algorithm(inputs: Inputs) -> Outputs: + """The main algorithm.""" + logger.debug('Inputs: %s', inputs) + # If create_tag is true, a git email address and a username are required. if inputs.create_tag: if inputs.git_email is None or inputs.git_username is None: raise ValueError('git email and username are required when a tag should be created!') - -def main_algorithm(inputs: Inputs) -> Outputs: - """The main algorithm.""" - logger.debug('Inputs: %s', inputs) - check_inputs(inputs) - with git.Repo(os.getcwd()) as repo: if inputs.mode == 'semantic': previous_version_tag_name, new_version, version_bumped = get_next_semantic_version(inputs, repo) diff --git a/get_release_version_action/utils/git.py b/get_release_version_action/utils/git.py index 26ad2ab..08cf03a 100644 --- a/get_release_version_action/utils/git.py +++ b/get_release_version_action/utils/git.py @@ -16,7 +16,7 @@ tag_creation_history: list[str] = [] -def create_git_tag(version: str, username: str | None, email: str | None) -> None: +def create_git_tag(version: str, username: str, email: str) -> None: """Create a new git tag for the given version and push it if a remote is configured.""" logger.info('Setting git username and email to %s <%s>', username, email) run_command('git', 'config', 'user.email', email) From d4b3e45200b2d09e70148cd3764462533ed452d5 Mon Sep 17 00:00:00 2001 From: bennetrr <bennet@bennetr.me> Date: Fri, 26 Apr 2024 16:28:08 +0200 Subject: [PATCH 9/9] chore: Fix typing --- get_release_version_action/algorithms/main_algorithm.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/get_release_version_action/algorithms/main_algorithm.py b/get_release_version_action/algorithms/main_algorithm.py index 88b81d5..f40bfb8 100644 --- a/get_release_version_action/algorithms/main_algorithm.py +++ b/get_release_version_action/algorithms/main_algorithm.py @@ -46,6 +46,9 @@ def main_algorithm(inputs: Inputs) -> Outputs: ('0.0.0' not in new_version_tag_name and previous_version_tag_name != new_version_tag_name)) if inputs.create_tag and new_tag_needed: + if inputs.git_email is None or inputs.git_username is None: + raise ValueError('git email and username are required when a tag should be created!') + create_git_tag(new_version_tag_name, inputs.git_username, inputs.git_email) output = Outputs(