-
Notifications
You must be signed in to change notification settings - Fork 40
41 lines (35 loc) · 1.45 KB
/
update-homebrew-formula.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Update Homebrew Formula on Release
on:
release:
types: [published]
jobs:
update-homebrew:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Generate GitHub App Token
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Get GitHub App User ID and setup the git environment
id: get-user-id
run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT"
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
- run: |
git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]'
git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com>'
- name: Update Homebrew formula
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
run: |
RELEASE_VERSION=${{ github.event.release.tag_name }}
RELEASE_VERSION=${RELEASE_VERSION#v}
BASE_REPO_URL="https://github.com/${GITHUB_REPOSITORY}"
BREW_TAP_REPO_URL="https://github.com/ppc64le-cloud/homebrew-pvsadm"
FORMULA_FILE="pvsadm.rb"
./ci/brew_formula_updater.sh "$BASE_REPO_URL" "$RELEASE_VERSION" "$BREW_TAP_REPO_URL" "$FORMULA_FILE"