Skip to content

Commit

Permalink
Also do the title check if the release is named for testing
Browse files Browse the repository at this point in the history
Now that the case where the release's name does not cause it to be
treated as a test release, but where the release is not announced
to a non-test discussion thread because it was found not to be
published (or was published but was marked back to draft), has been
manually tested, this commit uncomments the name-check case.

That is to say that this makes it so a release named as being for
testing, rather than being a "real" release, will trigger the
discussion title check. That way, releases that exist just to test
releasing are not inadvertently announced to discussion threads
intended for notifying about actual releases.

This check is done first, since it is the primary case for not
announcing a release that is otherwise eligible to be announced,
and because the log message for it makes more sense when both
reasons to do the title check apply.

At least for now, when the release name indicates the release is
for testing, the draft status of the release is not retrieved or
examined.

(However, as a possible future direction, it might be
worthwhile to check all three things -- release name, release
draft status, and whether the discussion is titled indicating it
is for testing -- and report them in the GitHub Actions
workflow/job log, for all combinations.)

This commit also adds a comment on the `announce-release` job
saying what it's for, as we have on the other `*-release` jobs.
  • Loading branch information
EliahKagan committed Nov 20, 2024
1 parent fe5c3ac commit 6b852d1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# Comment in a locked discussion that notifies about only `gitoxide` (e.g. not `gix-*`) releases.
announce-release:
runs-on: ubuntu-latest

Expand Down Expand Up @@ -463,13 +464,12 @@ jobs:
echo "DISCUSSION_ID=$id" >> "$GITHUB_ENV"
# FIXME: Uncomment name-checking case, after testing the draft-checking case!
- name: Avoid announcing a test in a non-test thread
run: |
case "$VERSION" in
# TEST-* | *-DO-NOT-USE ) # NOTE: Should be the same pattern as in `create-release` above.
# echo "The release name indicates testing, so we'll only post if the thread is for that."
# ;;
TEST-* | *-DO-NOT-USE ) # NOTE: Should be the same pattern as in `create-release` above.
echo "The release name indicates testing, so we'll only post if the thread is for that."
;;
* )
is_draft="$(gh release --repo="$REPOSITORY" view "$VERSION" --json isDraft --jq .isDraft)"
if [ "$is_draft" = false ]; then
Expand Down

0 comments on commit 6b852d1

Please sign in to comment.