Skip to content

Commit 4ccd9b6

Browse files
committed
fix(workflows): add GITHUB_TOKEN to Homebrew update workflow for secure authentication
1 parent 05566b9 commit 4ccd9b6

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

.github/workflows/scripts/update-homebrew.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,11 @@ async function updateHomebrew(version) {
214214
Auto-updated by GitHub Actions`;
215215

216216
execSync(`git commit -m "${commitMessage}"`, { cwd: homebrewPath });
217+
// Push using the token if available (for GitHub Actions)
218+
const token = process.env.GITHUB_TOKEN;
219+
if (token) {
220+
execSync(`git remote set-url origin https://${token}@github.com/hungthai1401/homebrew-tap.git`, { cwd: homebrewPath });
221+
}
217222
execSync("git push origin main", { cwd: homebrewPath });
218223
console.log("✅ Pushed to homebrew-tap repository");
219224
} catch (error) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ jobs:
5959
node .github/workflows/scripts/update-homebrew.js ${{ steps.version.outputs.version }}
6060
env:
6161
OCCTX_VERSION: ${{ steps.version.outputs.version }}
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6263

6364
- name: Verify formula was updated
6465
run: |

0 commit comments

Comments
 (0)