Update Snyk Scoop bucket with latest release #2236
This file contains hidden or 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 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: | |
jobs: | |
brew: | |
runs-on: ubuntu-latest | |
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) |