Skip to content

Commit

Permalink
chore: reduce output, check gh login auth status only if not logged in (
Browse files Browse the repository at this point in the history
  • Loading branch information
KenLSM committed Apr 24, 2024
1 parent 9e6cce4 commit a1106cd
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/release_prep.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
#!/bin/bash
set +x

set -x

# pre-requisites: install github CLI
# - github documentation: https://github.com/cli/cli#installation
# - github is remote 'origin'
# - PRs use test section LAST with heading "## Tests"
# - ALL build and release PRs start with "build: "

if ! command -v gh >/dev/null 2>&1; then
echo "Install gh first"
exit 1
fi

if ! gh auth status >/dev/null 2>&1; then
echo "You need to login: gh auth login"
exit 1
fi

has_local_changes=$(git status --porcelain --untracked-files=no --ignored=no)
if [[ ${has_local_changes} ]]; then
set +x
Expand Down Expand Up @@ -70,8 +80,6 @@ echo "## Dev-Dependencies" >> ${pr_body_file_groupped}
echo "" >> ${pr_body_file_groupped}
grep -E -- '- [a-z]+\(deps-dev\)' ${pr_body_file} >> ${pr_body_file_groupped}

gh auth login

## Extract test procedures for feature PRs
echo "" >> ${pr_body_file_groupped}
echo "## Tests" >> ${pr_body_file_groupped}
Expand Down

0 comments on commit a1106cd

Please sign in to comment.