diff --git a/README.md b/README.md index 7d2e953..a3754e9 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ You can pass the following flags into the action: | url | Supplementary URL to show with your message | | url_title | title for your supplementary URL | | device | Device name to send the message directly to | +| priority | Notification priority (low-to-high: -2 to 1) | Example: ``` @@ -58,6 +59,7 @@ Example: url: 'https://example.com' url_title: 'example' device: 'iphone' # or 'iphone,galaxy10' + priority: '1' # High priority ``` ## Versioning diff --git a/action.yml b/action.yml index 0ab7a06..835c666 100644 --- a/action.yml +++ b/action.yml @@ -17,6 +17,8 @@ inputs: description: 'title for your supplementary URL, otherwise just the URL is shown' device: description: 'Device name to send the message directly to, rather than all devices (multiple devices may be separated by a comma)' + priority: + description: 'Notification priority (low-to-high: -2 to 1)' runs: using: 'docker' image: 'Dockerfile' @@ -27,3 +29,4 @@ runs: - --url=${{ inputs.url }} - --url_title=${{ inputs.url_title }} - --device=${{ inputs.device }} + - --priority=${{ inputs.priority }} diff --git a/pushover.py b/pushover.py index 9672a30..0d3d11e 100644 --- a/pushover.py +++ b/pushover.py @@ -23,6 +23,9 @@ def main(): parser.add_argument('--device', type=str, help='Device name to send the message directly to') + parser.add_argument('--priority', + type=str, + help='Notification priority (low-to-high: -2 to 1)') args = parser.parse_args() try: token = os.environ['PUSHOVER_TOKEN'] @@ -42,6 +45,7 @@ def main(): 'url' : args.url, 'url_title' : args.url_title, 'device' : args.device, + 'priority' : args.priority, } response = requests.post('https://api.pushover.net/1/messages.json', headers=headers,