Update Homebrew Formula #64
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update Homebrew Formula | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [Release] | |
types: | |
- completed | |
jobs: | |
update-homefrew-formula: | |
if: ${{ github.event.workflow_run.conclusion == 'success' }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: lacework/homebrew-tap | |
path: homebrew-tap | |
token: ${{ secrets.token }} | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Create local Homebrew tap | |
working-directory: homebrew-tap | |
run: | | |
brew tap-new lacework/lacework-cli --no-git | |
sudo cp -r . $(brew --repository)/Library/Taps/lacework/homebrew-lacework-cli/ | |
- name: Update CLI Version | |
working-directory: homebrew-tap | |
env: | |
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
CI: true | |
run: | | |
sudo chmod -R 777 $(brew --repository)/Library/Taps/lacework/homebrew-lacework-cli/.git | |
cd $(brew --repository)/Library/Taps/lacework/homebrew-lacework-cli/ | |
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes | |
make update-cli-version | |
- name: Notify Slack on Failure | |
if: failure() | |
uses: slackapi/slack-github-action@v1.25.0 | |
with: | |
payload: | | |
{ | |
"attachments": [ | |
{ | |
"color": "#E92020", | |
"blocks": [ | |
{ | |
"type": "section", | |
"text": { | |
"type": "mrkdwn", | |
"text": "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:\n*GitHub Workflow Failure*\ngo-sdk/update-homebrew-formula\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}" | |
} | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL_GROWTH_ENG_ALERTS }} | |
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK |