Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions crates/sendbox-cli/tests/release_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"),
Expand All @@ -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);
Expand All @@ -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}"
);
}

Expand Down
5 changes: 3 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/release.sh
Original file line number Diff line number Diff line change
@@ -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' \
Expand Down
Loading