Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do the title check if the release is still a draft
For testing, this checks the discussion title only when the release is unpublished. Just for now, it does not also do the check in the previously covered case where the release is named to indicate that it exists to test releasing rather than being a "real" release. Really, we should test both, and we should probably check the name first, since when both apply, the name indicating that it is not even an actual release is the more important reason to avoid announcing it by commenting in a discussion for real release announcements. But the name check is temporarily commented out, in order to more easily test the draft status check. This checks whether the release is a draft by actually accessing the release, rather than repeating the check from the final step in the preceding `publish-release` job for whether it *should* be published, and also rather than storing and retrieving information about whether that job did publish it. The reason to actually check the release is that the draft status can be changed manually in either direction at any time: - Changing it between the jobs is plausible if one notices that something is unexpectedly broken (or unexpectedly okay). - But the more important reason is that we have to check each time, rather than using any state from the previous jobs we depend on, if we are to work as expected when the `announce-release` job itself is re-run (which makes sense to do, for example, if one has fixed a problem and manually marked a release non-draft). This change also refactors the steps, combining the two last steps in the job. The combination of the new `gh` invocation to check the draft status, and the consolation of those two steps, makes it so `GITHUB_TOKEN` is used in all steps and `REPOSITORY` is used in multiple steps. So this moves them from per-step `env` to job-level `env`. That leaves `DISCUSSION_URL` as the only step-level `env` key. Since it's not sensitive, nor likely to be used accidentally anywhere it shouldn't, it is also moved to the job-level `env` so it's easier to see what the job depends on.
- Loading branch information