Skip to content

Commit

Permalink
💥 feat!: GitHub mark-as-read now defaults to a disjunction of filters.
Browse files Browse the repository at this point in the history
BREAKING CHANGE: Default was conjunction.
  • Loading branch information
make-github-pseudonymous-again committed Feb 4, 2024
1 parent 39b9686 commit cbbeb1b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions .bin/github.mark_as_read.daemon
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,15 @@ while read -r line ; do
for filter in "${!filters[@]}"; do
passes "$pr" "$filter" "$updated_at"
rc="$?"
if [ "$rc" -ne 0 ] ; then
if [ "$rc" -eq 1 ] ; then
# shellcheck disable=SC2016
>&2 printf 'Not marking #%s as read: %s (%s) because it does not satisfy filter `%s`\n' "$id" "$title" "$pr" "$filter"
else
>&2 printf 'Not marking #%s as read: %s (%s) because of API error\n' "$id" "$title" "$pr"
fi
if [ "$rc" -eq 0 ] ; then
>&2 printf 'Marking thread #%s as read: %s (%s)\n' "$id" "$title" "$pr"
github.mark_as_read "$id"
continue 2
elif [ "$rc" -eq 1 ] ; then
# shellcheck disable=SC2016
>&2 printf 'Not marking #%s as read: %s (%s) because it does not satisfy filter `%s`\n' "$id" "$title" "$pr" "$filter"
else
>&2 printf 'Not marking #%s as read: %s (%s) because of API error\n' "$id" "$title" "$pr"
fi
done

>&2 printf 'Marking thread #%s as read: %s (%s)\n' "$id" "$title" "$pr"
github.mark_as_read "$id"
done
2 changes: 1 addition & 1 deletion .config/systemd/user/github.mark_as_read.service
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ Description=Github mark notifications read service
Type=simple
Restart=on-failure
RestartSec=300
ExecStart=/usr/bin/env github.mark_as_read.daemon '.user.login == "renovate[bot]"' '.state == "closed"'
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 comments on commit cbbeb1b

Please sign in to comment.