Skip to content

build_and_release #2328

build_and_release

build_and_release #2328

Workflow file for this run

name: "Update Snyk Scoop bucket with latest release"
on:
push:
branches:
- master
paths:
- "*"
- "!README.md"
schedule:
# Run workflow once a day to grab latest Snyk release
- cron: "0 0 * * *"
workflow_dispatch:
repository_dispatch:
types:
- build_and_release
jobs:
brew:
runs-on: ubuntu-latest
if: |
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'repository_dispatch' && github.event.client_payload && github.event.client_payload.release_channel == 'stable')
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.TEAM_CLI_BOT_GITHUB_PAT }}
- name: Set up Ruby 2.6
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6
- name: Render latest template
run: |
ruby render.rb | tee snyk.json
- name: Commit to repository
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COMMIT_MSG: |
Upgraded to latest Snyk version
skip-checks: true
run: |
# Hard-code user config
git config user.email "[email protected]"
git config user.name "Team CLI"
git config --get-regexp "user\.(name|email)"
# Checkout the branch so we can push back to it
git checkout master
git add snyk.json
# Only commit and push if we have changes
git diff --quiet && git diff --staged --quiet || (git commit -m "${COMMIT_MSG}"; git push origin master)