. #14
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: CI | |
on: [push] | |
jobs: | |
sast_scan: | |
name: Run brakeman scan | |
# Run this job on ubuntu-latest | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repo | |
uses: actions/checkout@v2 | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
bundler-cache: true | |
- name: Run brakeman | |
run: | | |
bundle exec brakeman -o brakeman.log | |
if grep -q "No warnings found" brakeman.log; then | |
echo "BRAKEMAN_STATUS=passing" >> $GITHUB_ENV | |
else | |
echo "BRAKEMAN_STATUS=failing" >> $GITHUB_ENV | |
fi | |
- name: Write log status to files | |
uses: "DamianReeves/write-file-action@master" | |
with: | |
path: brakeman_status.json | |
write-mode: overwrite | |
contents: | | |
{ | |
"status": "${{ env.BRAKEMAN_STATUS }}" | |
} | |
- name: Commit & Push | |
uses: Andro999b/[email protected] | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: main | |
force: true | |
message: 'Overwritten by Github Actions step `Run brakeman` - ${date}' |