From 28b32a9f3a5c817db39a7cd4a7bbe3e26cf2792e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Feb 2025 00:37:45 -0500 Subject: [PATCH 1/4] ci(deps): bump `python-semantic-release` & `tj-actions/changed-files` action (#1171) * ci(deps): bump `python-semantic-release/python-semantic-release@v9.17.0` action to 9.18.0 * ci(deps): bump `tj-actions/changed-files@v45.0.6` action to 45.0.7 --- .github/workflows/ci.yml | 4 ++-- .github/workflows/cicd.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89619f2e4..36b693d01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,13 +41,13 @@ jobs: - name: Evaluate | Check common file types for changes id: core-changed-files - uses: tj-actions/changed-files@v45.0.6 + uses: tj-actions/changed-files@v45.0.7 with: files_yaml_from_source_file: .github/changed-files-spec.yml - name: Evaluate | Check specific file types for changes id: ci-changed-files - uses: tj-actions/changed-files@v45.0.6 + uses: tj-actions/changed-files@v45.0.7 with: files_yaml: | ci: diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index abffd6fba..03c537ccc 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -26,14 +26,14 @@ jobs: - name: Evaluate | Check common file types for changes id: core-changed-files - uses: tj-actions/changed-files@v45.0.6 + uses: tj-actions/changed-files@v45.0.7 with: base_sha: ${{ github.event.push.before }} files_yaml_from_source_file: .github/changed-files-spec.yml - name: Evaluate | Check specific file types for changes id: ci-changed-files - uses: tj-actions/changed-files@v45.0.6 + uses: tj-actions/changed-files@v45.0.7 with: base_sha: ${{ github.event.push.before }} files_yaml: | @@ -138,7 +138,7 @@ jobs: build: false - name: Release | Add distribution artifacts to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.17.0 + uses: python-semantic-release/publish-action@v9.18.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ steps.release.outputs.tag }} From 7bc25d198a8ca00e64f5a3008179a904e85c7027 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Thu, 6 Feb 2025 08:36:09 -0500 Subject: [PATCH 2/4] chore(release-notes): update template to order issue references numerically (#1172) --- config/release-templates/.release_notes.md.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/release-templates/.release_notes.md.j2 b/config/release-templates/.release_notes.md.j2 index 2fa05eecb..584269ead 100644 --- a/config/release-templates/.release_notes.md.j2 +++ b/config/release-templates/.release_notes.md.j2 @@ -71,7 +71,7 @@ _This release is published under the MIT License._ %}{% for linked_issues in issue_resolving_commits | map(attribute="linked_issues") %}{% set _ = issue_numbers.extend(linked_issues) %}{% endfor -%}{% for issue_num in issue_numbers | unique | sort +%}{% for issue_num in issue_numbers | unique | sort_numerically %}{{ "\n- %s: _Title_\n" | format(format_link(issue_num | issue_url, issue_num)) }}{# From 37db2581620ad02e66716a4b3b365aa28abe65f8 Mon Sep 17 00:00:00 2001 From: codejedi365 Date: Fri, 7 Feb 2025 19:08:04 -0500 Subject: [PATCH 3/4] fix(config): refactors default token resolution to prevent pre-mature insecure URL error (#1173) Due to the previous default token loading, PSR configuration load would initate the default RemoteConfig. During validation of the remote config, the HVCS object was initialized and upon initialization the URL is evaluated for insecure protocol causing errors when the URL was pulled from the env. This change removes the need for initialization which means the URL validation will not occur pre-maturely Resolves: #1169, #1074 --- src/semantic_release/cli/config.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/semantic_release/cli/config.py b/src/semantic_release/cli/config.py index 7e5c31131..cd2d1bf13 100644 --- a/src/semantic_release/cli/config.py +++ b/src/semantic_release/cli/config.py @@ -54,7 +54,6 @@ ParserLoadError, ) from semantic_release.helpers import dynamic_import -from semantic_release.hvcs.remote_hvcs_base import RemoteHvcsBase from semantic_release.version.declaration import ( PatternVersionDeclaration, TomlVersionDeclaration, @@ -287,15 +286,18 @@ def set_default_token(self) -> Self: def _get_default_token(self) -> str | None: hvcs_client_class = _known_hvcs[self.type] - default_hvcs_instance = hvcs_client_class("git@example.com:owner/project.git") - if not isinstance(default_hvcs_instance, RemoteHvcsBase): - return None - default_token_name = default_hvcs_instance.DEFAULT_ENV_TOKEN_NAME - if not default_token_name: - return None + default_token_name = ( + getattr(hvcs_client_class, "DEFAULT_ENV_TOKEN_NAME") # noqa: B009 + if hasattr(hvcs_client_class, "DEFAULT_ENV_TOKEN_NAME") + else "" + ) - return EnvConfigVar(env=default_token_name).getvalue() + return ( + EnvConfigVar(env=default_token_name).getvalue() + if default_token_name + else None + ) @model_validator(mode="after") def check_url_scheme(self) -> Self: From f1e7f858d7951a054daed67880136da814c86969 Mon Sep 17 00:00:00 2001 From: semantic-release Date: Sat, 8 Feb 2025 00:20:43 +0000 Subject: [PATCH 4/4] 9.18.1 Automatically generated by python-semantic-release --- CHANGELOG.rst | 17 +++++++++++++++++ docs/automatic-releases/github-actions.rst | 14 +++++++------- pyproject.toml | 2 +- src/semantic_release/__init__.py | 2 +- 4 files changed, 26 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8c23d7de1..fb1e8ebfb 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,23 @@ CHANGELOG ========= +.. _changelog-v9.18.1: + +v9.18.1 (2025-02-08) +==================== + +🪲 Bug Fixes +------------ + +* **config**: Refactors default token resolution to prevent pre-mature insecure URL error, closes + `#1074`_, `#1169`_ (`PR#1173`_, `37db258`_) + +.. _#1074: https://github.com/python-semantic-release/python-semantic-release/issues/1074 +.. _#1169: https://github.com/python-semantic-release/python-semantic-release/issues/1169 +.. _37db258: https://github.com/python-semantic-release/python-semantic-release/commit/37db2581620ad02e66716a4b3b365aa28abe65f8 +.. _PR#1173: https://github.com/python-semantic-release/python-semantic-release/pull/1173 + + .. _changelog-v9.18.0: v9.18.0 (2025-02-06) diff --git a/docs/automatic-releases/github-actions.rst b/docs/automatic-releases/github-actions.rst index 384df5e64..c8cfd4098 100644 --- a/docs/automatic-releases/github-actions.rst +++ b/docs/automatic-releases/github-actions.rst @@ -337,7 +337,7 @@ before the :ref:`version ` subcommand. .. code:: yaml - - uses: python-semantic-release/python-semantic-release@v9.18.0 + - uses: python-semantic-release/python-semantic-release@v9.18.1 with: root_options: "-vv --noop" @@ -576,7 +576,7 @@ before the :ref:`publish ` subcommand. .. code:: yaml - - uses: python-semantic-release/publish-action@v9.18.0 + - uses: python-semantic-release/publish-action@v9.18.1 with: root_options: "-vv --noop" @@ -684,7 +684,7 @@ to the GitHub Release Assets as well. - name: Action | Semantic Version Release id: release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.18.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} git_committer_name: "github-actions" @@ -695,7 +695,7 @@ to the GitHub Release Assets as well. if: steps.release.outputs.released == 'true' - name: Publish | Upload to GitHub Release Assets - uses: python-semantic-release/publish-action@v9.18.0 + uses: python-semantic-release/publish-action@v9.18.1 if: steps.release.outputs.released == 'true' with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -744,7 +744,7 @@ The equivalent GitHub Action configuration would be: - name: Action | Semantic Version Release # Adjust tag with desired version if applicable. - uses: python-semantic-release/python-semantic-release@v9.18.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} force: patch @@ -772,13 +772,13 @@ Publish Action. .. code:: yaml - name: Release Project 1 - uses: python-semantic-release/python-semantic-release@v9.18.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: directory: ./project1 github_token: ${{ secrets.GITHUB_TOKEN }} - name: Release Project 2 - uses: python-semantic-release/python-semantic-release@v9.18.0 + uses: python-semantic-release/python-semantic-release@v9.18.1 with: directory: ./project2 github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index 1ea076196..b3cbed3ce 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta" [project] name = "python-semantic-release" -version = "9.18.0" +version = "9.18.1" description = "Automatic Semantic Versioning for Python projects" requires-python = ">=3.8" license = { text = "MIT" } diff --git a/src/semantic_release/__init__.py b/src/semantic_release/__init__.py index f64b8170c..9e823e6de 100644 --- a/src/semantic_release/__init__.py +++ b/src/semantic_release/__init__.py @@ -24,7 +24,7 @@ tags_and_versions, ) -__version__ = "9.18.0" +__version__ = "9.18.1" __all__ = [ "CommitParser",