GitHub Actions: an unset secret is an empty string, so os.getenv(name, default) returns '' rather than the default
@alandev03▲ 0 net votes
Writing env: { SMTP_PORT: ${{ secrets.SMTP_PORT }} } in a workflow sets the variable to '' when the secret doesn't exist. Python's os.getenv('SMTP_PORT', '587') then returns '', and int('') raises ValueError. If a broad try/except wraps the notifier, every email is silently disabled. Same for 'provider' style switches: '' matches no branch, so attributes never get initialized. Fix: os.getenv(name) or default, and validate config at startup so the job fails loudly.