Package: reponews
GitHub|PyPI|Issues|ChangelogDo you want to receive e-mail notifications about new issues, pull requests,
discussions, releases, tags, stargazers, & forks on your GitHub repositories?
Of course you do — but turning on e-mail notifications in GitHub for
repositories you’re watching will mean you get an e-mail for every comment on
every issue, which is a bit too much.reponewsaims for a happy medium:
only e-mailing you about new issues and similar activity — not about comments —
and only on repositories of your choice.  Simply set it up to run under cron or
another job scheduler (sold separately), point it at a compatible e-mail
sending service (also sold separately), and you’ll get periodic e-mails listing
new events.Installation & Setupreponewsrequires Python 3.8 or higher.  Just usepipfor Python 3 (You have pip, right?) to installreponewsand its dependencies:python3 -m pip install reponewsBefore runningreponewsfor the first time, you need toacquire a GitHub
personal access tokenfor fetching details about your repositories via the
GitHub GraphQL API, and you need to create a configuration file containing, at
a minimum:The access token or the path to a file containing itThe e-mail address thatreponewsshould send its reports toDetails on how to send those e-mailsAn example configuration file, for sending e-mails toluser@example.comwith
thesendmailcommand:[reponews]recipient="luser@example.com"auth-token="..."[outgoing]method="command"command=["sendmail","-i","-t"]See “Configuration” below for details.ExampleAn example of the sort of e-mail thatreponewsmight send you:[luser/my-repo] ISSUE #42: I found a bug (@bug-finder)
<https://github.com/luser/my-repo/issues/42>

@bug-fixer forked luser/my-repo
<https://github.com/bug.fixer/my-repo>

[luser/my-repo] PR #43: I fixed that bug (@bug-fixer)
<https://github.com/luser/my-repo/pull/43>

★ @repo-fan starred orgcorp/bigrepo

[orgcorp/bigrepo] DISCUSSION #123: How do I use this? (@confused-user)
<https://github.com/orgcorp/bigrepo/discussions/123>

[theteam/theproject] RELEASE v1.0a1 [prerelease]: v1 Preview (@github-actions[bot])
<https://github.com/theteam/theproject/releases/tag/v1.0a1>
> We're gearing up for the first full release!  Here are some changes you'll find:
>
> * Added a feature
> * Fixed a bug

Now tracking repository luser/brand-new-repo
<https://github.com/luser/brand-new-repo>
> This is the repository description.

No longer tracking repository tmprepos/deleted-repo

Repository renamed: team-member/new-project → theteam/new-projectUsagereponews [<options>]Thereponewscommand queries GitHub’s GraphQL API for new issues, pull
requests, discussions, releases, tags, stargazers, and/or forks on the
repositories specified in its configuration file (by default, all repositories
affiliated with the authenticated user) and composes & sends an e-mail listing
the events in chronological order.  Also included in the report are
notifications about newly-tracked and -untracked repositories and renamed
repositories.  If there is no new activity, no e-mail is sent.“New” activity is, in the general case, anything that has happened since the
last timereponewswas successfully run (specifically, since the last time
the state file was updated).  The first timereponewsis run, it merely
reports all the repositories that it is now tracking.  Ifreponewsstops
tracking a repository (usually because the repository listing in the config
file was edited) and then starts tracking it again, it willnotpick up where
it left off; instead, when it first starts tracking the repository again, it
will mark down that point in time and afterwards only report events occurring
after it.  Similar behavior occurs ifreponewsstops tracking a certain
type of activity and then starts tracking it again.Options-cPATH,--configPATHSpecify the configuration file to use.  See
“Configuration” below for the default config
file location.--dump-reposInstead of fetching repository activity, dump
the set of tracked repositories and their
configured activity preferences as a JSON
document-EFILE,--envFILELoad environment variables from the given.envfile.  By default, environment
variables are loaded from the first file named
“.env” found by searching from the current
directory upwards.-lLEVEL,--log-levelLEVELSet the log level to the given value.  Possible
values are “CRITICAL”, “ERROR”,
“WARNING”, “INFO”, “DEBUG” (all
case-insensitive) and their Python integer
equivalents.  [default:WARNING]--printCausereponewsto output the e-mail (as a
MIME document) instead of sending it--print-bodyCausereponewsto output the body of the
e-mail instead of sending it--save,--no-saveUpdate/do not update the state file on
successful completion [default:--save]Configurationreponewsis configured via aTOMLfile whose default
location depends on your OS:Linux~/.config/reponews/config.tomlor$XDG_CONFIG_HOME/reponews/config.tomlmacOS~/Library/Application Support/reponews/config.tomlWindows%USERPROFILE%\AppData\Local\jwodder\reponews\config.tomlThis TOML file must contain a[reponews]table with the following keys &
subtables (all of which are optional unless stated otherwise).  Unknown keys
result in an error.recipiente-mail address[Required when--print-bodyis not given] The e-mail address to whichreponewsshould send its reports.  This can be either a plain e-mail
address (e.g.,"me@example.com") or a display name with an address in
angle brackets (e.g.,"Madam E <me@example.com>").  Note that, if the
display name contains any punctuation, it needs to be enclosed in double
quotes, which then need to be escaped for use in the TOML string, e.g.,"\"JoeQ.  Recipient\" <jqr@example.net>".sendere-mail addressTheFrom:address to put onreponews’s e-mails; specified the same
way asrecipient.  Ifsenderis not specified, it is assumed that
the e-mail sending mechanism will automatically fill in theFrom:address appropriately.subjectstringThe subject to apply toreponews’s e-mails; defaults to “[reponews] New
activity on your GitHub repositories”.auth-tokenstringThe GitHub access token to use for interacting with the GitHub API.  Ifauth-tokenis not set, the token will be read from the file specified
byauth-token-file.  If neither key is set, the GitHub token is looked
up via the following sources, in order:TheGH_TOKENandGITHUB_TOKENenvironment variables (possibly set
via the.envfile; see the--envoption under “Options” above)Theghcommand, if installedThehubcommand’s configuration fileThehub.oauthtokenGit config optionauth-token-filepathThe path to a file containing the GitHub access token to use for
interacting with the GitHub API.  The file must contain only the token and
possibly leading and/or trailing whitespace.The path may start with a tilde (~) to indicate a file in the user’s
home directory.  A relative path will be resolved relative to the directory
containing the config file.state-filepathThe path to the file wherereponewswill store repository activity
state, used to determine the cutoff point for new activity.  The path may
start with a tilde (~) to indicate a file in the user’s home directory.
A relative path will be resolved relative to the directory containing the
config file.The default location for the state file depends on your OS:Linux~/.local/state/reponews/state.jsonor$XDG_STATE_HOME/reponews/state.jsonmacOS~/Library/Application Support/reponews/state.jsonWindows%USERPROFILE%\AppData\Local\jwodder\reponews\state.jsonapi-urlURLThe GraphQL endpoint to query; defaults to “https://api.github.com/graphql”activitytableA subtable describing what types of repository activity to fetch & track.
This table may contain the following keys:issuesbooleanWhether to report new issues in tracked repositories; defaults to truepull-requestsbooleanWhether to report new pull requests in tracked repositories; defaults
to truediscussionsbooleanWhether to report newdiscussionsin tracked repositories; defaults
to truereleasesbooleanWhether to report new releases in tracked repositories; defaults to
truetagsbooleanWhether to report new tags in tracked repositories; defaults to truereleased-tagsbooleanThis setting controls how to handle tags that are also made into
releases when both tags and releases are being tracked.  If true, such
tags are reported separately from the releases.  If false (the
default), such tags are not reported.starsbooleanWhether to report new stargazers for tracked repositories; defaults to
trueforksbooleanWhether to report new forks of tracked repositories; defaults to truemy-activitybooleanWhen false (the default), activity performed by the authenticated user
is not reported.affiliatedtableA subtable describing what types of repository activity to fetch &
track for repositories affiliated with the authenticated user.  The
table’s keys are the same as the boolean keys of[reponews.activity].repotableA subtable describing what types of repository activity to fetch &
track for specific repositories or repositories belonging to a given
user/organization.  The keys of the subtable must be of the form"owner/name"(for a specific repository) or"owner/*"(for all
repositories belonging to a given user/organization), and the values
must be subtables with the same boolean keys as[reponews.activity].By default, all repositories and repository owners listed as keys in[reponews.activity.repo]will be tracked byreponewsjust as if
they were listed underreponews.repos.include(see below).  This
can be disabled for a single key by settinginclude = falsein the
key’s subtable.When determining the activity to fetch & track for a repositoryowner/name, each setting is looked up in the relevant tables in the
following order, from highest precedence to lowest precedence:[reponews.activity.repo."owner/name"][reponews.activity.repo."owner/*"][reponews.activity.affiliated](if the repository is affiliated with
the authenticated user)[reponews.activity]repostableA subtable describing what repositories to track.  This table may contain
the following keys:affiliationslist of stringsA list of repository affiliations describing which repositories
associated with the authenticated user should be automatically tracked.
The affiliations are"OWNER"(for tracking repositories that the
user owns),"ORGANIZATION_MEMBER"(for tracking repositories
belonging to an organization of which the user is a member), and"COLLABORATOR"(for tracking repositories to which the user has
been added as a collaborator).  Unknown affiliations result in an
error.  Whenaffiliationsis not specified, it defaults to all
affiliation types.includelist of stringsA list of repositories to track in addition to affiliated repositories.
Repositories can be specified as either"owner/name"(for a
specific repository) or"owner/*"(for all repositories belonging
to a given user/organization).excludelist of stringsA list of repositories to exclude from tracking, specified the same way
as forinclude.  This option takes precedence over theaffiliationsandincludesettings.Example Configuration[reponews]recipient="luser@example.com"sender="RepoNews Bot <reponews@example.net>"# Fetch the GitHub access token from the "token.txt" file next to the# config file:auth-token-file="token.txt"state-file="~/.cache/reponews.json"[reponews.activity]# Don't report new issues or tags:issues=falsetags=false[reponews.activity.affiliated]# Do report new issues for affiliated repositories:issues=true[reponews.activity.repo."pypa/*"]# Don't report forks of pypa/* repositories:forks=false# Don't track all pypa/* repositories; only track those we're affiliated# with and those listed under `reponews.repos.include`.## Without this setting, the presence of `[reponews.activity.repo."pypa/*"]`# would cause reponews to track all repositories belonging to the pypa# organization.include=false[reponews.repos]affiliations=["OWNER","ORGANIZATION_MEMBER"]include=["pypa/packaging","pypa/pip","pypa/setuptools","some-user/*",]exclude=["some-user/boring-repo",]Sending E-Mailreponewsusesoutgoingfor sending e-mail, allowing it to handle multiple
sending methods like sendmail, SMTP, and more.  Theoutgoing configurationcan be located in thereponewsconfiguration file (as an[outgoing]table) or inoutgoing’s default configuration file.  Seeoutgoing’s
documentationfor more information.