Skip to content

Commit 96a8d17

Browse files
committed
fix: resolve HOMEBREW_TAP_TOKEN context access error in release workflow
1 parent 3fe5ac1 commit 96a8d17

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,19 +122,22 @@ jobs:
122122
| xargs -0 sha256sum > checksums.txt
123123
124124
- name: Generate Homebrew formula and push tap
125-
if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}
126125
env:
127126
VERSION: ${{ steps.tag.outputs.VERSION }}
128-
TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
127+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
129128
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
130133
set -euo pipefail
131134
TAR_URL="https://github.com/ruphy/sshdb/archive/refs/tags/v${VERSION}.tar.gz"
132135
SHA256=$(curl -L "$TAR_URL" | shasum -a 256 | awk '{print $1}')
133136
134137
mkdir -p /tmp/tap
135138
git config --global user.name "sshdb-release-bot"
136139
git config --global user.email "[email protected]"
137-
git clone "https://x-access-token:${TAP_TOKEN}@github.com/ruphy/homebrew-sshdb" /tmp/tap
140+
git clone "https://x-access-token:${HOMEBREW_TAP_TOKEN}@github.com/ruphy/homebrew-sshdb" /tmp/tap
138141
139142
cat > /tmp/tap/Formula/sshdb.rb <<EOF
140143
class Sshdb < Formula

0 commit comments

Comments
 (0)