Skip to content

Commit 3a63b99

Browse files
authored
ci: fix update-homebrew-formula.yml (#1575)
* ci: use local homebrew tap to release CLI * ci: split steps * ci: update * ci: fix permission * ci: fix permission * ci: fix permission * ci: add token * ci: update * ci: update * ci: fix token * ci: clean up
1 parent ac5fa63 commit 3a63b99

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

.github/workflows/chocolatey-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
publish-chocolatey:
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1213
runs-on: windows-latest
1314
steps:
1415
- uses: actions/checkout@v4

.github/workflows/update-cli-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99

1010
jobs:
1111
update-cli-docs:
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1213
runs-on: ubuntu-latest
1314
outputs:
1415
git-sha: ${{ steps.update.outputs.git-sha }}

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

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,38 @@ on:
99

1010
jobs:
1111
update-homefrew-formula:
12+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1213
runs-on: ubuntu-latest
1314
steps:
1415
- name: Checkout
1516
uses: actions/checkout@v4
1617
with:
1718
repository: lacework/homebrew-tap
1819
path: homebrew-tap
20+
token: ${{ secrets.token }}
21+
1922
- name: Set up Homebrew
2023
id: set-up-homebrew
2124
uses: Homebrew/actions/setup-homebrew@master
25+
26+
- name: Create local Homebrew tap
27+
working-directory: homebrew-tap
28+
run: |
29+
brew tap-new lacework/lacework-cli --no-git
30+
sudo cp -r . $(brew --repository)/Library/Taps/lacework/homebrew-lacework-cli/
31+
2232
- name: Update CLI Version
2333
working-directory: homebrew-tap
2434
env:
2535
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
2636
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
37+
CI: true
2738
run: |
28-
sudo apt-get update -y
29-
sudo apt-get install gpg-agent -y
39+
sudo chmod -R 777 $(brew --repository)/Library/Taps/lacework/homebrew-lacework-cli/.git
40+
cd $(brew --repository)/Library/Taps/lacework/homebrew-lacework-cli/
3041
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes
3142
make update-cli-version
43+
3244
- name: Notify Slack on Failure
3345
if: failure()
3446
uses: slackapi/[email protected]

0 commit comments

Comments
 (0)