Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
samples/
results/

# Local workflow reproduction scripts (intentionally untracked)
tests/custom/*

### Linux ###
*~

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ pip install -r requirements.txt
| `project-prefix` | ❌ | Prefix for project names | `ci-` |
| `project-suffix` | ❌ | Suffix for project names | `-prod` |
| `project-tags` | ❌ | Comma-separated tags | `production,ci-cd` |
| `delete-on-version-suffix-match` | ❌ | Delete existing leaf project when version matches suffix pattern (default `false`) | `true` |
| `delete-version-suffix-pattern` | ❌ | Case-insensitive regex evaluated against project version when delete is enabled (default `dev`) | `dev$` |

*One of `project-sbom`, `project-sbom-list`, or `project-sbom-dir` is required.

Expand Down
10 changes: 10 additions & 0 deletions src/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class AppConfig: # pylint: disable=too-many-instance-attributes
(default: "AGGREGATE_LATEST_VERSION_CHILDREN")
api_timeout (int): API request timeout in seconds (default: 300)
dry_run (bool): If True, perform a dry run without making changes (default: False)
delete_on_version_suffix_match (bool): Delete existing project when version matches suffix pattern
delete_version_suffix_pattern (str): Regex pattern (case-insensitive) used to detect versions
Raises:
ConfigurationError: If required configuration is missing or invalid
ValidationError: If validation of specific fields fails
Expand Down Expand Up @@ -71,6 +73,8 @@ class AppConfig: # pylint: disable=too-many-instance-attributes
is_latest: bool = False
auto_detect_latest: bool = True
dry_run: bool = False
delete_on_version_suffix_match: bool = False
delete_version_suffix_pattern: str = "dev"

# Tags
project_tags: Optional[str] = None
Expand Down Expand Up @@ -203,6 +207,12 @@ def from_environment(cls) -> "AppConfig":
).strip(),
hierarchy_input_dir=os.getenv("INPUT_HIERARCHY_INPUT_DIR", "").strip() or None,
api_timeout=int(os.getenv("INPUT_API_TIMEOUT", "300").strip()),
delete_on_version_suffix_match=(
os.getenv("INPUT_DELETE_ON_VERSION_SUFFIX_MATCH", "false").strip().lower() == "true"
),
delete_version_suffix_pattern=(
os.getenv("INPUT_DELETE_VERSION_SUFFIX_PATTERN", "dev").strip() or "dev"
),
)

def validate_for_upload(self) -> None:
Expand Down
2 changes: 2 additions & 0 deletions src/domain/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ class HTTPStatus(Enum): # pylint: disable=too-few-public-methods

OK = 200
CREATED = 201
NO_CONTENT = 204
UNAUTHORIZED = 401
FORBIDDEN = 403
CONFLICT = 409
Loading