Skip to content

feat: set remote.type dynamically from env #1099

@huxuan

Description

@huxuan

Feature Request

Description

I have a template project hosted both on GitHub and GitLab mostly for demostration, and I want to leverage both GitHub Actions and GitLab CI/CD, so I need to set the remote.type dynamically. But it seems that a validation error will happen when I try to set an env for it.

Expected behavior

Possibility to set remote.type with env.

Actual behavior

A validation error is raised.

Environment

  • Operating System (w/ version): Ubuntu 22.04
  • Python version: 3.10.12
  • Pip version: N/A
  • Semantic-release version: 9.14.0
  • Build tool (w/ version): N/A
pip freeze
N/A

git log --oneline --decorate --graph --all -n 50
N/A

Configuration

Semantic Release Configuration
[tool.semantic_release.remote.type]
env = "SEMANTIC_RELEASE_REMOTE_TYPE"
default = "github"

Build System Configuration
N/A

GitHub Actions Job Definition
N/A

Execution Log

semantic-release -vv command
[06:05:45] DEBUG    [main.main] logging level set to: DEBUG                                                                                                                                             main.py:124
🛡 You are running in no-operation mode, because the '--noop' flag was supplied
           DEBUG    [main.main] global cli options: GlobalCommandLineOptions(noop=True, verbosity=2, config_file='pyproject.toml', strict=False)                                                        main.py:139
           INFO     [util.load_raw_config_file] Loading configuration from pyproject.toml                                                                                                                util.py:79
           DEBUG    [util.load_raw_config_file] Trying to parse configuration pyproject.toml in TOML format                                                                                              util.py:82
1 validation error for RawConfig
remote.type
  Input should be 'bitbucket', 'github', 'gitlab' or 'gitea' [type=enum, input_value={'env': 'SEMANTIC_RELEASE...E', 'default': 'github'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.9/v/enum

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedPrevent from becoming stalefeatureA new feature or a feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy