Skip to content

Commit 43cdde9

Browse files
committed
fix(ci): avoid secrets in workflow conditionals
1 parent f63be0f commit 43cdde9

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,29 @@ jobs:
128128
name: Update Homebrew tap
129129
runs-on: ubuntu-24.04
130130
needs: release
131-
if: ${{ secrets.HOMEBREW_TAP_TOKEN != '' }}
131+
env:
132+
HOMEBREW_TAP_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
132133

133134
steps:
135+
- name: Skip when tap token is unavailable
136+
if: ${{ env.HOMEBREW_TAP_TOKEN == '' }}
137+
run: echo "HOMEBREW_TAP_TOKEN is not configured; skipping tap update."
138+
134139
- name: Check out tap repository
140+
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
135141
uses: actions/checkout@v4
136142
with:
137143
repository: oops-rs/homebrew-tap
138144
ref: main
139-
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
145+
token: ${{ env.HOMEBREW_TAP_TOKEN }}
140146
path: tap
141147

142148
- name: Update langcodec-cli formula
149+
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
143150
run: bash tap/scripts/update-formula.sh langcodec-cli "${RELEASE_TAG}"
144151

145152
- name: Commit updated formula
153+
if: ${{ env.HOMEBREW_TAP_TOKEN != '' }}
146154
run: |
147155
if git -C tap diff --quiet -- Formula; then
148156
echo "langcodec-cli formula already up to date"

0 commit comments

Comments
 (0)