Skip to content

Commit

Permalink
fix(run): notification message when process killed
Browse files Browse the repository at this point in the history
For some reason the `conclusion` field from GitHub is the run's URL when
it's still in progress, rather than empty. This fixes the formatting of
the notification that's displayed when the process is killed via:
    $ killall gh
  • Loading branch information
benelan committed Jun 1, 2024
1 parent 9f1281a commit b419d35
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion gh-fzf
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,13 @@ notify_run_completed() {

IFS=$OLDIFS

title="${workflow:-GitHub Action run completed}"
title="${workflow:-GitHub Action run concluded}"

# The `conclusion` field is the run's URL if it is still in progress. This
# causes weird notification formatting in an edge case where the watch
# process gets killed (e.g., by `killall gh`.)
case $conclusion in https://*) conclusion="notification cancelled for run" ;; esac

body="${conclusion}${branch:+" on '$branch' branch"}"

if has dunstify; then
Expand Down

0 comments on commit b419d35

Please sign in to comment.