File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change 3434
3535 - name : Checkout code
3636 uses : actions/checkout@v4
37+ with :
38+ fetch-depth : 0 # full history for git describe
39+
40+ - name : Fetch tags
41+ run : git fetch --force --prune --tags
3742
3843 - name : Install reconFTW
3944 shell : bash
Original file line number Diff line number Diff line change 11#! /bin/bash
22
33# Safer bash defaults
4- set -Eeuo pipefail
4+ set -o pipefail
5+ set -E
6+ set +e
57IFS=$' \n\t '
68
79# Detect if the script is being run in MacOS with Homebrew Bash
@@ -448,9 +450,14 @@ function check_updates() {
448450 printf " %bRunning: Looking for new reconFTW version%b\n" " $bblue " " $reset "
449451
450452 if { [[ -n " $TIMEOUT_CMD " ]] && $TIMEOUT_CMD 10 git fetch; } || git fetch; then
451- BRANCH=$( git rev-parse --abbrev-ref HEAD)
452- HEADHASH=$( git rev-parse HEAD)
453- UPSTREAMHASH=$( git rev-parse " ${BRANCH} @{upstream}" )
453+ BRANCH=$( git rev-parse --abbrev-ref HEAD 2> /dev/null || echo " HEAD" )
454+ HEADHASH=$( git rev-parse HEAD 2> /dev/null || true)
455+ # Skip auto-update if no upstream (detached HEAD or no tracking branch)
456+ if ! git rev-parse --abbrev-ref --symbolic-full-name @{u} > /dev/null 2>&1 ; then
457+ printf " %bNo upstream configured (detached HEAD). Skipping auto-update.%b\n" " $yellow " " $reset "
458+ return 0
459+ fi
460+ UPSTREAMHASH=$( git rev-parse " @{u}" )
454461
455462 if [[ $HEADHASH != " $UPSTREAMHASH " ]]; then
456463 if git status --porcelain | grep -q . ; then
You can’t perform that action at this time.
0 commit comments