diff --git a/crates/sendbox-cli/tests/release_script.rs b/crates/sendbox-cli/tests/release_script.rs index 5970470..9109892 100644 --- a/crates/sendbox-cli/tests/release_script.rs +++ b/crates/sendbox-cli/tests/release_script.rs @@ -151,7 +151,15 @@ case "$1 $2" in fi printf 'success\n' >"$RELEASE_TEST_STATE/conclusion" ;; - "release view") printf 'https://github.com/mbianchidev/sendbox/releases/tag/v0.2.0\n' ;; + "release view") + url='https://github.com/mbianchidev/sendbox/releases/tag/v0.2.0' + pager="${GH_PAGER-${PAGER-}}" + if [[ -t 1 && -n "$pager" && "$pager" != cat ]]; then + printf '%s\n' "$url" | "$pager" + else + printf '%s\n' "$url" + fi + ;; *) printf 'Unexpected GitHub command: %s\n' "$*" >&2 exit 1 @@ -486,7 +494,7 @@ fn switches_to_updated_main_before_releasing_and_refreshing_every_lockfile() { } #[test] -fn disables_configured_git_pagers_when_releasing_in_a_terminal() { +fn disables_configured_git_and_gh_pagers_when_releasing_in_a_terminal() { let repository = ReleaseRepository::new(); executable( repository.bin.join("pager"), @@ -506,6 +514,7 @@ fn disables_configured_git_pagers_when_releasing_in_a_terminal() { "/bin/bash", ]) .env("GIT_PAGER", "pager") + .env("GH_PAGER", "pager") .env("PAGER", "pager"); let result = repository.run_command(command, &[version], "success"); repository.assert_succeeded(&result); @@ -514,7 +523,7 @@ fn disables_configured_git_pagers_when_releasing_in_a_terminal() { let trace = repository.trace(); assert!( !trace.contains("pager invoked"), - "release invoked the configured Git pager:\n{trace}" + "release invoked a configured pager:\n{trace}" ); } diff --git a/docs/installation.md b/docs/installation.md index dc841cf..99956f6 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -252,8 +252,9 @@ Actions workflows. Cargo is also required when preparing a new version bump. For a new release, pass a stable `X.Y.Z` version greater than the version on `main`; a leading `v` is also accepted. -Git pagers are disabled for the script and its subprocesses, so output never -pauses for pager input. +Git and GitHub CLI pagers are disabled for the script and its subprocesses, so +output never pauses for pager input and the script exits on its own after +printing the release URL. After its preflight safety checks, the script switches the invoking checkout to `main` and pulls `origin/main` with `--ff-only` before inspecting or resuming diff --git a/scripts/release.sh b/scripts/release.sh index fd689ba..e0c49b6 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -export GIT_PAGER=cat +export GIT_PAGER=cat GH_PAGER=cat usage() { printf 'Usage: %s VERSION\nSwitch to main, pull fast-forward-only, then create or resume a release.\n' \