-
Notifications
You must be signed in to change notification settings - Fork 285
51 lines (44 loc) · 1.38 KB
/
publish_brew.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
42
43
44
45
46
47
48
49
50
51
name: Publish and Update Brew
on:
workflow_dispatch:
inputs:
release:
description: "The name of the released version to publish"
required: true
env:
STEAMPIPE_VERSION: ${{ github.event.inputs.release }}
GH_TOKEN: ${{ secrets.GH_ACCESS_TOKEN }}
jobs:
update_homebrew_tap:
name: Update homebrew-tap formula
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: turbot/homebrew-tap
token: ${{ secrets.GH_ACCESS_TOKEN }}
ref: main
- name: Get pull request title
id: pr_title
run: >-
echo "PR_TITLE=$(
gh pr view $STEAMPIPE_VERSION --json title | jq .title | tr -d '"'
)" >> $GITHUB_OUTPUT
- name: Output
run: |
echo ${{ steps.pr_title.outputs.PR_TITLE }}
echo ${{ env.STEAMPIPE_VERSION }}
- name: Fail if PR title does not match with version
run: |
if ${{ (steps.pr_title.outputs.PR_TITLE == env.STEAMPIPE_VERSION) }} == 'true';then
echo "Correct version"
else
echo "Incorrect version"
exit 1
fi
- name: Merge pull request to update brew formula
run: |
git fetch --all
gh pr merge $STEAMPIPE_VERSION --squash --delete-branch
git push origin --delete bump-brew