Legitify Scan (PAT) #16
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: Legitify Scan (PAT) | |
on: [workflow_dispatch] | |
permissions: | |
actions: read | |
contents: read | |
security-events: write | |
issues: write | |
jobs: | |
scan-repository: | |
name: Scan Repository | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Scan Repo | |
uses: Legit-Labs/legitify@b814483c588aefad01b33e921008e73352639277 | |
with: | |
github_token: ${{ secrets.GH_PAT }} | |
analyze_self_only: "true" | |
scorecard: yes | |
- name: Create Summary Issue | |
if: success() | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
DATE=`date +%m-%d-%Y` | |
URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
jq --null-input --arg date $DATE --arg url $URL '{"scan_date": $date, "scan_url": $url}' > data.json | |
pip install jinja2-cli | |
gh issue create \ | |
--title "Daily Scan Report - ${DATE}" \ | |
--body "$(jinja2 ./.github/templates/scan-report.md data.json)" \ | |
--label "repository-report" | |
- name: Create Error Issue | |
if: failure() | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
DATE=`date +%m-%d-%Y` | |
URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | |
jq --null-input --arg date $DATE --arg url $URL '{"scan_date": $date, "scan_url": $url}' > data.json | |
pip install jinja2-cli | |
gh issue create \ | |
--title "Repository Scan Failed - ${DATE}" \ | |
--body "$(jinja2 ./.github/templates/scan-report-failure.md data.json)" \ | |
--label "repository-report, failure" | |