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 }} 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/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)) }}{# 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", 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: