|
| 1 | +name: HOL plugin scan |
| 2 | + |
| 3 | +# Runs HOL's AI plugin scanner (hashgraph-online/ai-plugin-scanner-action) over |
| 4 | +# the repo: manifests, skills, the opt-in MCP server, workflow permissions and |
| 5 | +# dependency pinning. The HOL registry lists this pack and takes 10% off its |
| 6 | +# Trust Score while no security scan runs in the source repo's CI (#510). |
| 7 | +# |
| 8 | +# Static and offline: `online` stays false, so the scanner reads the checkout |
| 9 | +# and nothing else, and submission automation stays off. The run fails only |
| 10 | +# on a high or critical finding; lower findings show in the job summary and, |
| 11 | +# on main, in the Security tab via SARIF. |
| 12 | +# |
| 13 | +# The `cisco` dispatch input also installs and runs the Cisco skill scanner, |
| 14 | +# the one HOL times out on for every skill (#513). |
| 15 | + |
| 16 | +on: |
| 17 | + workflow_dispatch: |
| 18 | + inputs: |
| 19 | + cisco: |
| 20 | + description: "Also run the Cisco skill scanner (slower; #513)" |
| 21 | + type: boolean |
| 22 | + default: false |
| 23 | + schedule: |
| 24 | + - cron: "0 9 * * 3" # weekly, Wednesday 09:00 UTC |
| 25 | + push: |
| 26 | + branches: [main] |
| 27 | + pull_request: |
| 28 | + branches: [main] |
| 29 | + |
| 30 | +permissions: |
| 31 | + contents: read |
| 32 | + |
| 33 | +concurrency: |
| 34 | + group: plugin-scan-${{ github.ref }} |
| 35 | + cancel-in-progress: true |
| 36 | + |
| 37 | +jobs: |
| 38 | + scan: |
| 39 | + name: Scan the plugin with the HOL AI plugin scanner |
| 40 | + runs-on: ubuntu-latest |
| 41 | + timeout-minutes: 30 |
| 42 | + permissions: |
| 43 | + contents: read |
| 44 | + security-events: write # SARIF upload; used on main only |
| 45 | + steps: |
| 46 | + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 |
| 47 | + |
| 48 | + - name: Scan |
| 49 | + id: scan |
| 50 | + uses: hashgraph-online/ai-plugin-scanner-action@5065ff849b5255dc24a8092c084a1c5060d8633e # v1.2.807 |
| 51 | + with: |
| 52 | + plugin_dir: "." |
| 53 | + mode: scan |
| 54 | + format: sarif |
| 55 | + output: plugin-scan.sarif |
| 56 | + fail_on_severity: high |
| 57 | + upload_sarif: ${{ github.event_name != 'pull_request' }} |
| 58 | + publish_hint: false |
| 59 | + cisco_skill_scan: ${{ inputs.cisco && 'on' || 'auto' }} |
| 60 | + install_cisco: ${{ inputs.cisco || false }} |
| 61 | + |
| 62 | + - name: Record the score |
| 63 | + if: always() && steps.scan.outputs.score != '' |
| 64 | + run: | |
| 65 | + echo "score=${{ steps.scan.outputs.score }} grade=${{ steps.scan.outputs.grade }}" \ |
| 66 | + "max_severity=${{ steps.scan.outputs.max_severity }}" \ |
| 67 | + "findings=${{ steps.scan.outputs.findings_total }}" |
0 commit comments