From fe8d5b42e0c0dc0ae33bd9a4ece3018f6f3ed5be Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Fri, 13 Mar 2026 20:43:17 +0000 Subject: [PATCH 1/2] Fix optional_int function to return None for empty strings and update priority argument type --- pushover.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pushover.py b/pushover.py index f539992..8a4dffb 100755 --- a/pushover.py +++ b/pushover.py @@ -4,6 +4,12 @@ import argparse import requests +def optional_int(value): + """Convert string to int, treating empty strings as None""" + if value == '': + return None + return int(value) + def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--message', type=str, help='Message text') @@ -11,7 +17,7 @@ def get_args(): parser.add_argument('--url', type=str, help='Supplementary URL to show with your message') parser.add_argument('--url_title', type=str, help='title for your supplementary URL, otherwise just the URL is shown') parser.add_argument('--device', type=str, help='Device name to send the message directly to') - parser.add_argument('--priority', type=int, help='Notification priority (low-to-high: -2 to 1)') + parser.add_argument('--priority', type=optional_int, help='Notification priority (low-to-high: -2 to 1)') parser.add_argument('--sound', type=str, help='The name of a supported sound (https://pushover.net/api#sounds; custom sounds are supported)') args = parser.parse_args() return args @@ -48,7 +54,7 @@ def main(): if device: payload['device'] = device if priority: - payload['priority'] = priority + payload['priority'] = str(priority) if sound: payload['sound'] = sound -- 2.49.1 From f34c3b96e4df79ef0673bfc30f8475d026edb053 Mon Sep 17 00:00:00 2001 From: Luke Tainton Date: Fri, 13 Mar 2026 20:49:19 +0000 Subject: [PATCH 2/2] Rename workflow to validate PR title and update job configuration --- .gitea/workflows/conventional_commit.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitea/workflows/conventional_commit.yml b/.gitea/workflows/conventional_commit.yml index bb8caa7..a2ce159 100644 --- a/.gitea/workflows/conventional_commit.yml +++ b/.gitea/workflows/conventional_commit.yml @@ -1,4 +1,4 @@ -name: Conventional Commit +name: Validate PR Title on: pull_request: types: @@ -8,7 +8,9 @@ on: - reopened jobs: - validate_pr_title: - uses: https://git.tainton.uk/actions/gha-workflows/.gitea/workflows/conventional-commit.yml@main - with: - commit_message: ${{ gitea.event.pull_request.title }} + validate: + runs-on: ubuntu-latest + steps: + - uses: https://git.tainton.uk/actions/conventional-commits-check-action@v1.3.0 + with: + commit-message: ${{ gitea.event.pull_request.title }} -- 2.49.1