-
-
Notifications
You must be signed in to change notification settings - Fork 364
127 lines (114 loc) · 4.21 KB
/
housekeeping.yaml
File metadata and controls
127 lines (114 loc) · 4.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
name: Housekeeping
on:
# Run daily at 6:45
schedule:
- cron: '45 6 * * *'
workflow_dispatch:
env:
IMAGE_NAME: threatdragon/owasp-threat-dragon:latest
# for security reasons the github actions are pinned to specific SHAs
jobs:
chores:
name: Tidy workflows
runs-on: ubuntu-24.04
permissions:
actions: write
steps:
- name: Delete stale workflow runs
uses: Mattraks/delete-workflow-runs@5bf9a1dac5c4d041c029f0a8370ddf0c5cb5aeb7 # v2.1.0
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@f586d3fe7f959c38ca76a0030521dfa47946bce3 # v4.0.6
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@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0
with:
days-before-issue-stale: 183
days-before-issue-close: -1
stale-issue-message: 'This issue is stale because it has been open for 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 4 weeks 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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
- name: Run Trivy vulnerability scanner
# Pinned to commit for v0.35.0
uses: aquasecurity/trivy-action@57a97c7e7821a5776cebc9bb87c984fa69cba8f1
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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
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@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
ref: main
- name: Initialize CodeQL
uses: github/codeql-action/init@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
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@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
- name: Perform vulnerability analysis
uses: github/codeql-action/analyze@38697555549f1db7851b81482ff19f1fa5c4fedc # v4.34.1
link_checker:
name: Link checker
runs-on: ubuntu-24.04
steps:
- name: Checkout markdown
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Link Checker
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
with:
args: >-
--verbose
--no-progress
--max-retries 1
--retry-wait-time 10
'docs/**/*.md'
'docs/*.md'
'*.md'
fail: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}