Skip to content

Commit 6b852d1

Browse files
committed
Also do the title check if the release is named for testing
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.
1 parent fe5c3ac commit 6b852d1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

.github/workflows/release.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ jobs:
429429
env:
430430
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
431431

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

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

0 commit comments

Comments
 (0)