feat: add a security-advisories action shared by coop and osprey

Merged
RE
7d ago
+800-33

See #19 for broader context.

tl;dr: since Github actions don't support security advisories, we have to periodically poll the API to support them. I'm moving the composite action for this into from roostorg/coop#1523 in discord-bot itself so that we can share it across multiple repos (e.g. coop and osprey) instead of duplicating it.

Testing

  • python3 -m unittest discover -s security-advisories: 14 tests pass. They include an end-to-end run of the list and post steps against a fake GitHub API and a fake Discord webhook. That run checks the message text, that mentions are disabled, that nothing is reposted on the next run, and that a Discord error leaks no advisory data to the log.
  • Checked by hand that post.sh still skips draft PRs and still errors on an empty webhook.
  • zizmor 1.25.2 and actionlint report nothing on the new files. zizmor's two existing findings in discord.yml (pull_request_target, @main pin) are unchanged.