Skip to content

Commit 0f6438d

Browse files
committed
modify workflow for github app deployment
1 parent b451f72 commit 0f6438d

1 file changed

Lines changed: 14 additions & 6 deletions

File tree

.github/workflows/publish-homebrew.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,23 @@ jobs:
1111
publish-homebrew-formula:
1212
runs-on: ubuntu-22.04
1313
env:
14-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1514
PLAN: ${{ inputs.plan }}
16-
GITHUB_USER: "axo bot"
17-
GITHUB_EMAIL: "admin+bot@axo.dev"
1815
if: ${{ !fromJson(inputs.plan).announcement_is_prerelease || fromJson(inputs.plan).publish_prereleases }}
1916
steps:
17+
- name: Generate GitHub App token
18+
id: app-token
19+
uses: actions/create-github-app-token@v1
20+
with:
21+
app-id: ${{ secrets.HOTDATA_AUTOMATION_APP_ID }}
22+
private-key: ${{ secrets.HOTDATA_AUTOMATION_PRIVATE_KEY }}
23+
owner: hotdata-dev
24+
repositories: homebrew-tap
25+
2026
- uses: actions/checkout@v6
2127
with:
2228
persist-credentials: true
2329
repository: "hotdata-dev/homebrew-tap"
24-
token: ${{ secrets.HOMEBREW_TAP_TOKEN }}
30+
token: ${{ steps.app-token.outputs.token }}
2531

2632
- name: Fetch homebrew formulae
2733
uses: actions/download-artifact@v7
@@ -32,8 +38,8 @@ jobs:
3238

3339
- name: Patch and commit formula files
3440
run: |
35-
git config --global user.name "${GITHUB_USER}"
36-
git config --global user.email "${GITHUB_EMAIL}"
41+
git config --global user.name "hotdata-automation[bot]"
42+
git config --global user.email "hotdata-automation[bot]@users.noreply.github.com"
3743
3844
for release in $(echo "$PLAN" | jq --compact-output '.releases[] | select([.artifacts[] | endswith(".rb")] | any)'); do
3945
filename=$(echo "$release" | jq '.artifacts[] | select(endswith(".rb"))' --raw-output)
@@ -55,6 +61,8 @@ jobs:
5561
git push
5662
5763
- name: Remove .rb from GitHub Release assets
64+
env:
65+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5866
run: |
5967
TAG=$(echo "$PLAN" | jq -r '.announcement_tag')
6068
if [ -z "$TAG" ] || [ "$TAG" = "null" ]; then

0 commit comments

Comments
 (0)