Skip to content

Commit 343090c

Browse files
committed
fix: improve Homebrew token check using step output instead of env check
1 parent 96a8d17 commit 343090c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,15 +121,21 @@ jobs:
121121
| sort -z \
122122
| xargs -0 sha256sum > checksums.txt
123123
124+
- name: Check if Homebrew token is set
125+
id: check_token
126+
run: |
127+
if [ -n "${{ secrets.HOMEBREW_TAP_TOKEN }}" ]; then
128+
echo "token_set=true" >> $GITHUB_OUTPUT
129+
else
130+
echo "token_set=false" >> $GITHUB_OUTPUT
131+
fi
132+
124133
- name: Generate Homebrew formula and push tap
134+
if: steps.check_token.outputs.token_set == 'true'
125135
env:
126136
VERSION: ${{ steps.tag.outputs.VERSION }}
127137
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
128138
run: |
129-
if [ -z "${HOMEBREW_TAP_TOKEN:-}" ]; then
130-
echo "HOMEBREW_TAP_TOKEN is not set, skipping Homebrew tap update"
131-
exit 0
132-
fi
133139
set -euo pipefail
134140
TAR_URL="https://github.com/ruphy/sshdb/archive/refs/tags/v${VERSION}.tar.gz"
135141
SHA256=$(curl -L "$TAR_URL" | shasum -a 256 | awk '{print $1}')

0 commit comments

Comments
 (0)