Files
cve/.github/workflows/audit_poc_links.yml
T

105 lines
3.1 KiB
YAML

name: Audit PoC Links
on:
schedule:
- cron: '40 3 * * *'
workflow_dispatch:
permissions:
contents: write
actions: write
concurrency:
group: repository-updates
queue: max
cancel-in-progress: false
jobs:
audit:
runs-on: ubuntu-latest
timeout-minutes: 50
steps:
- name: Checkout repository
uses: actions/checkout@v7
with:
ref: main
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: '3.13'
# The hourly sweep checks front-page repositories plus 2,000 older repos
# and 500 artifact URLs. This deeper scan also includes reference links,
# curated file paths and recovery checks for previously unavailable URLs.
- name: Drop dead links and refresh repository metadata
id: link_audit
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python3 scripts/audit_poc_links.py --limit 4000 --references 10000 --workers 32 --timeout 5
- name: Verify the generated index
run: python3 scripts/build_site.py --offline
- name: Record published artifact releases
run: python3 scripts/releases.py --record
- name: Refresh published counts
run: |
python3 .github/hero.py
python3 .github/getTrending.py --counts-only
- name: Check for changes and commit
id: commit
run: |
git config user.name 'CVE-BOT'
git config user.email '[email protected]'
git add --all -- \
.github/link_audit_state.json \
index/link_health.json \
index/github.txt \
index/repo_meta.json \
index/kev.json \
index/references.txt \
index/reference_pocs.txt \
index/trending.json \
README.md \
docs/hero.svg \
docs/social-card.svg \
docs/stats.json \
docs/kev.svg \
index/releases/ \
cves/
if git diff --cached --quiet; then
echo "No changes to commit"
exit 0
fi
git commit -m "Drop PoC links to deleted repositories $(date -u +'%Y-%m-%d')"
for attempt in 1 2 3; do
if git push origin HEAD:main; then
echo "pushed=true" >> "$GITHUB_OUTPUT"
exit 0
fi
echo "Push rejected; replaying onto the current main (attempt $attempt)"
git fetch --unshallow origin main 2>/dev/null || git fetch origin main
git rebase FETCH_HEAD || { git rebase --abort; exit 1; }
done
exit 1
# Commits pushed with the workflow token raise no push event, so site.yml
# would otherwise wait for its daily schedule. Dispatching is exempt.
- name: Rebuild and deploy the site
if: steps.commit.outputs.pushed == 'true'
env:
GH_TOKEN: ${{ github.token }}
run: gh workflow run site.yml --ref main
- name: Report incomplete repository checks
if: always() && steps.link_audit.outcome == 'failure'
run: exit 1