diff --git a/.github/workflows/test_action.yaml b/.github/workflows/test_action.yaml index ef649c4..2166d4a 100644 --- a/.github/workflows/test_action.yaml +++ b/.github/workflows/test_action.yaml @@ -2,6 +2,7 @@ name: Test Action on: pull_request: branches: [ "main" ] + types: [ opened, labeled ] jobs: get-num-square: diff --git a/src/control_multi_version.py b/src/control_multi_version.py index 4d1bb6b..4330f6b 100644 --- a/src/control_multi_version.py +++ b/src/control_multi_version.py @@ -88,8 +88,9 @@ def update_version(arg, label_list): isBumpLabelNotExist = True for version_type in list(VersionCategory): + print(f'bump-{version_type.name.lower()}') if f'bump-{version_type.name.lower()}' in label_list: - isBumpLabelExist = false + isBumpLabelExist = False bump_version(version_type, arg['version_code_variable_name'], arg['version_name_variable_name'], version_code, major_version, minor_version, patch_version, revision_version) if isBumpLabelNotExist: @@ -104,8 +105,9 @@ def bump_version(version_category, vc_variable_name, vn_variable_name, version_c my_file.write(f"CURRENT_VERSION_NAME={major_version}.{minor_version}.{patch_version}.{revision_version}\n") my_file.write(f"CURRENT_VERSION_CODE={version_code}\n") - # version_code는 항상 증가 - version_code += 1 + # bump label 없는 경우에만 version code 증가 + if (version_category is VersionCategory.NONE): + version_code += 1 if version_category is VersionCategory.REVISION: revision_version += 1