Housekeeping #682
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: Housekeeping | |
on: | |
# Run daily at 7:00 | |
schedule: | |
- cron: '0 7 * * *' | |
workflow_dispatch: | |
env: | |
IMAGE_NAME: threatdragon/owasp-threat-dragon:latest | |
# for security reasons the github actions are pinned to specific release versions | |
jobs: | |
chores: | |
name: Tidy workflows | |
runs-on: ubuntu-24.04 | |
permissions: | |
actions: write | |
steps: | |
- name: Delete stale workflow runs | |
uses: Mattraks/delete-workflow-runs@v2.0.6 | |
with: | |
token: ${{ github.token }} | |
repository: ${{ github.repository }} | |
retain_days: 28 | |
keep_minimum_runs: 10 | |
- name: Delete unused workflows | |
uses: otto-de/purge-deprecated-workflow-runs@v2.0.3 | |
with: | |
token: ${{ github.token }} | |
stale: | |
name: Tidy pull requests | |
runs-on: ubuntu-24.04 | |
permissions: | |
pull-requests: write | |
issues: write | |
steps: | |
- name: Tidy stale PRs and issues | |
uses: actions/stale@v9 | |
with: | |
days-before-issue-stale: 190 | |
days-before-issue-close: -1 | |
stale-issue-message: 'This issue is stale because it has been open for more than 6 months with no activity' | |
stale-issue-label: stale | |
remove-issue-stale-when-updated: true | |
days-before-pr-stale: 21 | |
days-before-pr-close: 7 | |
stale-pr-message: 'This PR is stale because it has been open 21 days with no activity. Remove stale label, or add a comment, otherwise it will be closed in 7 days' | |
close-pr-message: 'This PR was closed because it has been stalled for 28 days with no activity' | |
trivy: | |
name: Scan with Trivy | |
runs-on: ubuntu-24.04 | |
permissions: | |
contents: write | |
security-events: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.2.0 | |
with: | |
ref: main | |
- name: Run Trivy vulnerability scanner | |
uses: aquasecurity/trivy-action@0.29.0 | |
with: | |
image-ref: '${{ env.IMAGE_NAME }}' | |
format: 'template' | |
template: '@/contrib/sarif.tpl' | |
trivyignores: '.github/workflows/.trivyignore' | |
output: 'trivy-results.sarif' | |
- name: Upload scan results to GitHub Security tab | |
uses: github/codeql-action/upload-sarif@v3.27.0 | |
with: | |
sarif_file: 'trivy-results.sarif' | |
codeql: | |
name: Analyze with codeql | |
runs-on: ubuntu-24.04 | |
permissions: | |
security-events: write | |
strategy: | |
fail-fast: false | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4.2.0 | |
with: | |
ref: main | |
- name: Initialize CodeQL | |
uses: github/codeql-action/init@v3.27.0 | |
with: | |
languages: 'javascript' | |
config-file: ./.github/codeql/codeql-config.yml | |
# If you wish to specify custom queries, you can do so here or in a config file. | |
# By default, queries listed here will override any specified in a config file. | |
# Prefix the list here with "+" to use these queries and those in the config file. | |
- name: CodeQL autobuild | |
uses: github/codeql-action/autobuild@v3.27.0 | |
- name: Perform vulnerability analysis | |
uses: github/codeql-action/analyze@v3.27.0 | |
link_checker: | |
name: Link checker | |
runs-on: ubuntu-24.04 | |
steps: | |
- name: Checkout markdown | |
uses: actions/checkout@v4.2.0 | |
- name: Link Checker | |
uses: lycheeverse/lychee-action@v2.1.0 | |
with: | |
fail: true | |
env: | |
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |