Skip to content

Commit 4e2625f

Browse files
author
Power Cloud Robot
authored
Merge pull request #703 from carmal891/fix/homebrew-version-bumper
Adds Github workflow to update homebrew formula in pvsadm tap repository on release
2 parents 149a34b + 2063d19 commit 4e2625f

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.github/workflows/update-homebrew-formula.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ jobs:
3131
3232
- name: Update Homebrew formula
3333
env:
34-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN}}
3534
GH_TOKEN: ${{ steps.app-token.outputs.token }}
3635
run: |
3736
RELEASE_VERSION=${{ github.event.release.tag_name }}

ci/brew_formula_updater.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ if [ "$#" -ne 4 ]; then
2222
exit 1
2323
fi
2424

25-
# Ensure GitHub token and GH CLI token are set
26-
if [[ -z "$GITHUB_TOKEN" || -z "$GH_TOKEN" ]]; then
27-
echo "Error: Required tokens are not set."
25+
# Ensure GitHub app token is set
26+
if [[ -z "$GH_TOKEN" ]]; then
27+
echo "Error: Required token is not set."
2828
exit 1
2929
fi
3030

@@ -146,16 +146,13 @@ fi
146146
# Commit and push updated formula file to remote tap repository
147147
git add "$FORMULA_FILE"
148148
git commit -m "Update formula to version $NEW_VERSION"
149-
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@${BREW_TAP_REPO_URL#https://}
149+
git remote set-url origin https://x-access-token:${GH_TOKEN}@${BREW_TAP_REPO_URL#https://}
150150

151151
if ! git push origin "$BRANCH_NAME"; then
152152
echo "Error: Failed to push branch $BRANCH_NAME"
153153
exit 1
154154
fi
155155

156-
# Need to unset GITHUB_TOKEN for gh cli to use GH_TOKEN instead
157-
unset GITHUB_TOKEN
158-
159156
# Create PR
160157
if gh pr create --head "$BRANCH_NAME" \
161158
--title "Updates formula to version $NEW_VERSION" \

0 commit comments

Comments
 (0)