mirror of
https://github.com/K-Dense-AI/scientific-agent-skills.git
synced 2026-12-04 09:34:03 +08:00
- Enhanced the README to clarify the publication of security scan results to a dedicated markdown file. - Modified `scan_skills.py` to generate both a human-readable report and a machine-readable JSON report, ensuring consistency checks before CI publishing. - Updated the GitHub Actions workflow to validate the scan report and commit the new reports, replacing the previous SECURITY.md approach with separate report files. This change improves the clarity and accessibility of security information for users and contributors.
64 lines
1.9 KiB
YAML
64 lines
1.9 KiB
YAML
name: Weekly Security Scan
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 9 * * 1" # Every Monday at 09:00 UTC
|
|
workflow_dispatch: # Allow manual trigger
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
jobs:
|
|
scan:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 120
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: astral-sh/setup-uv@v8.0.0
|
|
with:
|
|
enable-cache: true
|
|
cache-dependency-glob: uv.lock
|
|
python-version: "3.13"
|
|
|
|
- name: Install dependencies
|
|
run: uv sync --python 3.13
|
|
|
|
- name: Run security scan
|
|
env:
|
|
SKILL_SCANNER_LLM_API_KEY: ${{ secrets.SKILL_SCANNER_LLM_API_KEY }}
|
|
SKILL_SCANNER_LLM_MODEL: ${{ vars.SKILL_SCANNER_LLM_MODEL || 'claude-sonnet-5' }}
|
|
run: uv run python scan_skills.py
|
|
|
|
# Gate: a scan that contradicts the contents of skills/ must not be
|
|
# published. A non-zero exit here fails the job, so the commit step below
|
|
# is skipped and the previous report stays in place.
|
|
- name: Validate scan report
|
|
run: uv run python validate_report.py
|
|
|
|
- name: Upload report artifact
|
|
if: always()
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: security-report
|
|
path: |
|
|
docs/security-report.md
|
|
docs/security-report.json
|
|
if-no-files-found: warn
|
|
|
|
- name: Commit updated security report
|
|
run: |
|
|
if [ -z "$(git status --porcelain docs/security-report.md docs/security-report.json)" ]; then
|
|
echo "Report unchanged; nothing to commit."
|
|
exit 0
|
|
fi
|
|
git config user.name "github-actions[bot]"
|
|
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
|
git stash --include-untracked
|
|
git pull --rebase
|
|
git stash pop || true
|
|
git add docs/security-report.md docs/security-report.json
|
|
git commit -m "chore: update security scan report [skip ci]"
|
|
git push
|