Skip to content

Commit cbbeb1b

Browse files
💥 feat!: GitHub mark-as-read now defaults to a disjunction of filters.
BREAKING CHANGE: Default was conjunction.
1 parent 39b9686 commit cbbeb1b

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

.bin/github.mark_as_read.daemon

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,15 @@ while read -r line ; do
6565
for filter in "${!filters[@]}"; do
6666
passes "$pr" "$filter" "$updated_at"
6767
rc="$?"
68-
if [ "$rc" -ne 0 ] ; then
69-
if [ "$rc" -eq 1 ] ; then
70-
# shellcheck disable=SC2016
71-
>&2 printf 'Not marking #%s as read: %s (%s) because it does not satisfy filter `%s`\n' "$id" "$title" "$pr" "$filter"
72-
else
73-
>&2 printf 'Not marking #%s as read: %s (%s) because of API error\n' "$id" "$title" "$pr"
74-
fi
68+
if [ "$rc" -eq 0 ] ; then
69+
>&2 printf 'Marking thread #%s as read: %s (%s)\n' "$id" "$title" "$pr"
70+
github.mark_as_read "$id"
7571
continue 2
72+
elif [ "$rc" -eq 1 ] ; then
73+
# shellcheck disable=SC2016
74+
>&2 printf 'Not marking #%s as read: %s (%s) because it does not satisfy filter `%s`\n' "$id" "$title" "$pr" "$filter"
75+
else
76+
>&2 printf 'Not marking #%s as read: %s (%s) because of API error\n' "$id" "$title" "$pr"
7677
fi
7778
done
78-
79-
>&2 printf 'Marking thread #%s as read: %s (%s)\n' "$id" "$title" "$pr"
80-
github.mark_as_read "$id"
8179
done

.config/systemd/user/github.mark_as_read.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Description=Github mark notifications read service
55
Type=simple
66
Restart=on-failure
77
RestartSec=300
8-
ExecStart=/usr/bin/env github.mark_as_read.daemon '.user.login == "renovate[bot]"' '.state == "closed"'
8+
ExecStart=/usr/bin/env github.mark_as_read.daemon '.user.login == "renovate[bot]" and .state == "closed"' '.title == ":arrow_up: deps: Upgrade codecov/codecov-action action to v4"'

0 commit comments

Comments
 (0)