Repository navigation
Daily static security scan #65
This file contains hidden or 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: Daily static security scan | |
| on: | |
| schedule: | |
| - cron: '41 5 * * *' # 每天 05:41 UTC(错峰,避开整点) | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| scan: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Run static security scan | |
| run: python -u scripts/security-scan.py --limit 100 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit if changed | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add src/data/security.json | |
| if git diff --cached --quiet; then | |
| echo "no change" | |
| else | |
| git commit -m "chore: daily security scan ($(date -u +%Y-%m-%d))" | |
| git push | |
| fi |