ci: Create workflow update-homebrew-formula.yml #34
Workflow file for this run
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: | |
pull_request: | |
jobs: | |
update-homefrew-formula: | |
# runs-on: arc-runner-lacework-generic-medium | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: write | |
# container: | |
# image: homebrew/brew:latest | |
# options: --user root | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: lacework/homebrew-tap | |
path: homebrew-tap | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: lacework-dev/actions | |
# ref: main | |
# path: github-actions | |
# token: ${{secrets.TOKEN }} | |
- name: Set up Homebrew | |
id: set-up-homebrew | |
uses: Homebrew/actions/setup-homebrew@master | |
- name: Update CLI Version | |
working-directory: homebrew-tap | |
env: | |
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }} | |
run: | | |
sudo apt-get update -y | |
sudo apt-get install gpg-agent -y | |
echo "$GPG_SECRET_KEY" | base64 --decode | gpg --import --no-tty --batch --yes | |
make update-cli-version | |
# - name: Set up Python 3.x | |
# uses: actions/setup-python@v5 | |
# with: | |
# python-version: "3.x" | |
# - name: Notify Slack on Failure | |
# if: failure() | |
# uses: ./github-actions/report-to-slack-v1 | |
# with: | |
# channel-id: "pengyuan-test" | |
# title: "*GitHub Workflow Failure*" | |
# attachment_color: "#E92020" | |
# env: | |
# SLACK_MSG_Github_Workflow_URL: "<https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}|Click Here To View Workflow Run>" | |
# SLACK_MSG_Github_Workflow_Name: "go-sdk/update-homebrew-formula" | |
# SLACK_MSG_Message: "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:" | |
# TITLE_TEXT: "@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:" | |
- 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": "*GitHub Workflow Failure*\ngo-sdk/update-homebrew-formula\n*Workflow Run*\n https://github.com/lacework/go-sdk/actions/runs/${{ github.run_id }}\n@oncall-growth-eng! There has been a failure that needs your attention. :rotating_light:" | |
} | |
} | |
] | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: "https://hooks.slack.com/services/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" |