discord: notify this repo about its own issues - #10
Merged
Merged
Conversation
This repo supplies every other repo's Discord notifications and had none for its own issues. An issue filed here reached nobody, which is how #9 was filed into silence. Adds an `issues` trigger and an inline job using this repo's own discord-notify action. Inline rather than a fourth reusable workflow: a reusable workflow here is an interface other repos pin, and adding one is a bigger decision than this repo notifying itself. gaia keeps its own issue notifier inline for the same reason. Also gates notify_pr on `github.event_name == 'pull_request'`, which it did not need while only pull_request and push fired this file. On a push `github.event.action` is empty, so the composer's else branch drops the message and the stray job is invisible. An issue is not like that — its action is literally `opened`, which the composer's first branch matches, so without the gate every issue would post a PR notification carrying an empty title and number.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9 — or rather, makes it visible. This repo supplies every other repo's Discord notifications and had none for its own issues, so #9 was filed into silence.
Adds an
issuestrigger and an inline job using this repo's owndiscord-notifyaction.Inline rather than a fourth reusable workflow. A reusable workflow here is an interface other repos pin by SHA, and adding one is a bigger decision than this repo notifying itself. gaia keeps its own issue notifier inline for the same reason. If a reusable
discord_issue.ymlis wanted so gaia can drop its copy, that is worth doing deliberately rather than as a side effect of this.Spend attention on the second hunk, not the first.
notify_prhad noif, which was harmless while onlypull_requestandpushfired this file: on a pushgithub.event.actionis empty, the composer'selsedrops the message, and the stray job is invisible. An issue is not like that — its action is literallyopened, which the composer's first branch matches. Without the gate, every issue would post a PR notification carrying an empty title and number. I found that by listing the job conditions after adding the trigger, not by reasoning about it.Not fixed here: this repo's own
pull_requesttypes areopened, closedwith noreopened, so it has the same gap #9 describes for consumers. That wants the composer fix first, since subscribing to an event the composer drops is what #9 is about.To verify, file a throwaway issue here and close it.