Update Snyk Scoop bucket with latest release #1858
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 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@master | |
- 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 "Gareth Rushgrove" | |
git config --get-regexp "user\.(name|email)" | |
# Update origin with token | |
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
# 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) |