Skip to content

Merge branch 'master' into support-109727 #953

Merge branch 'master' into support-109727

Merge branch 'master' into support-109727 #953

name: Security Checks (pr)
on:
workflow_dispatch:
push:
schedule:
- cron: '0 5 * * *'
concurrency:
group: qb-${{ github.ref }}-pr-security
cancel-in-progress: true
jobs:
bearer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: install bearer
run: |
sudo apt-get install apt-transport-https
echo "deb [trusted=yes] https://apt.fury.io/bearer/ /" | sudo tee -a /etc/apt/sources.list.d/fury.list
sudo apt-get update
sudo apt-get install bearer
- name: run bearer
run: |
BEARER_DIFF_BASE_BRANCH=master bearer scan --quiet --config-file ./bearer.yml --diff .
- name: build bearer report
if: failure()
run: |
BEARER_DIFF_BASE_BRANCH=master bearer scan --quiet --config-file ./bearer.yml --diff . > bearer_full.txt
- name: upload bearer failure report
uses: actions/upload-artifact@v4
if: failure()
with:
name: bearer-pr-report
path: bearer_full.txt
- name: Write to Job Summary
if: failure()
run: grep -A 10 '=====================================' bearer_full.txt >> $GITHUB_STEP_SUMMARY
brakeman:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: "Download artifact"
run: |
OTHER_REPO="health-connector/enroll"
WF_NAME="security-code-scan-daily.yml"
ARTIFACT_NAME="brakeman-json-report"
RUN_ID=`gh run --repo health-connector/enroll list --workflow security-code-scan-daily.yml --json databaseId --jq '.[0].databaseId'`
gh run --repo ${OTHER_REPO} download ${RUN_ID} -n ${ARTIFACT_NAME}
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Brakeman code scanning
run: docker run -v "$(pwd)":/code presidentbeef/brakeman --compare daily_run.json -o /dev/stdout -o brakeman_output.text
- name: upload Brakeman failure report
uses: actions/upload-artifact@v4
if: failure()
with:
name: brakeman-pr-report
path: brakeman_output.text
- name: Write to Job Summary
if: failure()
run: cat brakeman_output.text >> $GITHUB_STEP_SUMMARY