Skip to content

Commit 387bfff

Browse files
author
liuboping
committed
fix(ci): update Homebrew tap publish to use token auth
- Use HOMEBREW_TOKEN secret for authenticated push - Explicitly specify GitHub URL in clone command - Remove unused SHA256 output line
1 parent 46e98e4 commit 387bfff

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,18 @@ jobs:
188188
if: env.HOMEBREW_TAP_REPO != ''
189189
env:
190190
VERSION: ${{ steps.version.outputs.VERSION }}
191+
HOMEBREW_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
191192
run: |
192-
# Install coreutils for sha256sum (ubuntu doesn't have it by default)
193+
# Install coreutils for sha256sum
193194
sudo apt-get update
194195
sudo apt-get install -y coreutils
195196
196197
# Clone tap repo
197-
git clone "https://${{ secrets.HOMEBREW_TAP_REPO }}.git" /tmp/homebrew-tap
198+
git clone "https://github.com/${{ secrets.HOMEBREW_TAP_REPO }}.git" /tmp/homebrew-tap
198199
cd /tmp/homebrew-tap
199200
200201
# Calculate sha256 for macOS zip
201202
SHA256=$(sha256sum "../releases/lbpSSH-macos-universal.zip" | cut -d' ' -f1)
202-
echo "SHA256=$SHA256" >> $GITHUB_OUTPUT
203203
204204
# Update cask file
205205
sed -i "s/version \".*\"/version \"$VERSION\"/" Casks/lbpssh.rb
@@ -210,7 +210,7 @@ jobs:
210210
git config user.email "actions@github.com"
211211
git add Casks/lbpssh.rb
212212
git commit -m "Update lbpssh to $VERSION"
213-
git push
213+
git push "https://$HOMEBREW_TOKEN@github.com/${{ secrets.HOMEBREW_TAP_REPO }}.git"
214214
215215
release-draft:
216216
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)