Skip to content

Commit f6742ba

Browse files
committed
feat: add ignore_warnings param
1 parent a04971a commit f6742ba

7 files changed

Lines changed: 32 additions & 28 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# CHANGELOG
22

3-
## Next Release
3+
## v3.3.0 (2026-01-13)
44

5-
Use `uv` instead of `pip` for faster dependency installation
5+
- Adds `ignore_warnings` param to skip failing the action at the end for raised non-critical warnings
6+
- Use `uv` instead of `pip` for faster dependency installation
67

78
## v3.2.1 (2026-01-11)
89

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,10 @@ jobs:
195195
# Logs debugging info to console.
196196
# Default is shown - boolean
197197
debug: false
198+
199+
# Ignores non-critical warnings by not raising them at the end and failing the action.
200+
# Default is shown - boolean
201+
ignore_warnings: false
198202
```
199203
200204
#### Python Formula

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ inputs:
8686
description: 'Logs debugging info to console.'
8787
required: false
8888
default: 'false'
89+
ignore_warnings:
90+
description: 'Ignores non-critical warnings by not raising them at the end and failing the action.'
91+
required: false
92+
default: 'false'
8993
runs:
9094
using: docker
9195
image: docker://justintime50/homebrew-releaser:3.2.1
@@ -114,3 +118,4 @@ runs:
114118
- ${{ inputs.skip_commit }}
115119
- ${{ inputs.skip_checksum }}
116120
- ${{ inputs.debug }}
121+
- ${{ inputs.ignore_warnings }}

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ services:
3131
- INPUT_SKIP_COMMIT=
3232
- INPUT_SKIP_CHECKSUM=
3333
- INPUT_DEBUG=true
34+
- INPUT_IGNORE_WARNINGS=

homebrew_releaser/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "3.2.1"
1+
__version__ = "3.3.0"

homebrew_releaser/app.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
GITHUB_TOKEN,
2727
HOMEBREW_OWNER,
2828
HOMEBREW_TAP,
29+
IGNORE_WARNINGS,
2930
INSTALL,
3031
LOGGER_NAME,
3132
SKIP_CHECKSUM,
@@ -239,7 +240,7 @@ def run_github_action():
239240
upload_checksum_file(latest_release)
240241
logger.info(f"Successfully released {version} of {GITHUB_REPO} to {HOMEBREW_TAP}.")
241242

242-
if non_critical_warnings:
243+
if non_critical_warnings and not IGNORE_WARNINGS:
243244
logger.info("The following non-critical warnings were raised during execution:")
244245
for i, warning in enumerate(non_critical_warnings):
245246
logger.warning(f"{i + 1}. {warning}")

homebrew_releaser/constants.py

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import os
22

33

4+
def _get_bool_env_var(var_name: str, default: bool = False) -> bool:
5+
value = os.getenv(var_name)
6+
if not value:
7+
return default
8+
return value.lower() != "false"
9+
10+
411
# Global variables
512
non_critical_warnings: list[str] = []
613

@@ -24,31 +31,16 @@
2431
else False
2532
)
2633
VERSION = os.getenv("INPUT_VERSION")
27-
TARGET_DARWIN_AMD64 = (
28-
os.getenv("INPUT_TARGET_DARWIN_AMD64", False) if os.getenv("INPUT_TARGET_DARWIN_AMD64") != "false" else False
29-
) # Must check for string `false` since GitHub Actions passes the bool as a string
30-
TARGET_DARWIN_ARM64 = (
31-
os.getenv("INPUT_TARGET_DARWIN_ARM64", False) if os.getenv("INPUT_TARGET_DARWIN_ARM64") != "false" else False
32-
) # Must check for string `false` since GitHub Actions passes the bool as a string
33-
TARGET_LINUX_AMD64 = (
34-
os.getenv("INPUT_TARGET_LINUX_AMD64", False) if os.getenv("INPUT_TARGET_LINUX_AMD64") != "false" else False
35-
) # Must check for string `false` since GitHub Actions passes the bool as a string
36-
TARGET_LINUX_ARM64 = (
37-
os.getenv("INPUT_TARGET_LINUX_ARM64", False) if os.getenv("INPUT_TARGET_LINUX_ARM64") != "false" else False
38-
) # Must check for string `false` since GitHub Actions passes the bool as a string
34+
TARGET_DARWIN_AMD64 = _get_bool_env_var("INPUT_TARGET_DARWIN_AMD64")
35+
TARGET_DARWIN_ARM64 = _get_bool_env_var("INPUT_TARGET_DARWIN_ARM64")
36+
TARGET_LINUX_AMD64 = _get_bool_env_var("INPUT_TARGET_LINUX_AMD64")
37+
TARGET_LINUX_ARM64 = _get_bool_env_var("INPUT_TARGET_LINUX_ARM64")
3938
CUSTOM_TARBALL = os.getenv("INPUT_CUSTOM_TARBALL")
40-
UPDATE_README_TABLE = (
41-
os.getenv("INPUT_UPDATE_README_TABLE", False) if os.getenv("INPUT_UPDATE_README_TABLE") != "false" else False
42-
) # Must check for string `false` since GitHub Actions passes the bool as a string
43-
SKIP_COMMIT = (
44-
os.getenv("INPUT_SKIP_COMMIT", False) if os.getenv("INPUT_SKIP_COMMIT") != "false" else False
45-
) # Must check for string `false` since GitHub Actions passes the bool as a string
46-
SKIP_CHECKSUM = (
47-
os.getenv("INPUT_SKIP_CHECKSUM", False) if os.getenv("INPUT_SKIP_CHECKSUM") != "false" else False
48-
) # Must check for string `false` since GitHub Actions passes the bool as a string
49-
DEBUG = (
50-
os.getenv("INPUT_DEBUG", False) if os.getenv("INPUT_DEBUG") != "false" else False
51-
) # Must check for string `false` since GitHub Actions passes the bool as a string
39+
UPDATE_README_TABLE = _get_bool_env_var("INPUT_UPDATE_README_TABLE")
40+
SKIP_COMMIT = _get_bool_env_var("INPUT_SKIP_COMMIT")
41+
SKIP_CHECKSUM = _get_bool_env_var("INPUT_SKIP_CHECKSUM")
42+
DEBUG = _get_bool_env_var("INPUT_DEBUG")
43+
IGNORE_WARNINGS = _get_bool_env_var("INPUT_IGNORE_WARNINGS")
5244

5345
# App Constants
5446
LOGGER_NAME = "homebrew-releaser"

0 commit comments

Comments
 (0)