mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
alternative homebrew updater
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
5ca26ed3ca
commit
4481669f68
39
.github/workflows/release-homebrew.yaml
vendored
39
.github/workflows/release-homebrew.yaml
vendored
@ -1,10 +1,8 @@
|
|||||||
name: "Release Homebrew"
|
name: "Release Homebrew core formula"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
release:
|
workflow_call:
|
||||||
types:
|
|
||||||
- released
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
homebrew:
|
homebrew:
|
||||||
@ -16,33 +14,22 @@ jobs:
|
|||||||
# we need to be able to get the commit for a tag
|
# we need to be able to get the commit for a tag
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Get release info
|
- name: Get current release info
|
||||||
id: release_info
|
id: release_info
|
||||||
run: |
|
run: |
|
||||||
echo -n "tag_name=$(gh release view --json tagName --jq '.tagName')" | tee -a $GITHUB_OUTPUT
|
echo -n "tag_name=$(gh release view --json tagName --jq '.tagName')" | tee -a $GITHUB_OUTPUT
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Get commit info
|
- name: Bump homebrew-core formula
|
||||||
id: git_info
|
uses: mislav/bump-homebrew-formula-action@b3327118b2153c82da63fd9cbf58942146ee99f0 #v3
|
||||||
run: |
|
# skip if this looks like a pre-release tag
|
||||||
git checkout ${{ steps.release_info.outputs.tag_name }}
|
if: !contains(inputs.tag_name, '-')
|
||||||
echo -n "commit=$(git rev-parse HEAD)" | tee -a $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Update Homebrew formula
|
|
||||||
uses: dawidd6/action-homebrew-bump-formula@baf2b60c51fc1f8453c884b0c61052668a71bd1d # v3.11.0
|
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.HOMEBREW_TOKEN }}
|
formula-name: syft
|
||||||
org: anchore
|
# https://github.com/Homebrew/homebrew-core/blob/master/Formula/s/syft.rb
|
||||||
formula: syft
|
formula-path: Formula/s/syft.rb
|
||||||
tag: ${{ steps.release_info.outputs.tag_name }}
|
tag-name: ${{ inputs.tag_name }}
|
||||||
revision: ${{ steps.git_info.outputs.commit }}
|
push-to: anchore/homebrew-core
|
||||||
|
|
||||||
- uses: 8398a7/action-slack@28ba43ae48961b90635b50953d216767a6bea486 #v3.16.2
|
|
||||||
if: ${{ failure() }}
|
|
||||||
with:
|
|
||||||
status: ${{ job.status }}
|
|
||||||
fields: repo,workflow,action,eventName
|
|
||||||
text: "Post-release homebrew publish workflow has failed: https://github.com/anchore/syft/actions/workflows/release-homebrew.yaml"
|
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_TOOLBOX_WEBHOOK_URL }}
|
COMMITTER_TOKEN: ${{ secrets.HOMEBREW_TOKEN }}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user