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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
name: Dependencies
on:
schedule:
# Run weekly on Sundays at 2 AM UTC
- cron: '0 2 * * 0'
workflow_dispatch:
jobs:
update_rust_dependencies:
name: Update Rust Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-edit
run: cargo install cargo-edit
- name: Update dependencies
run: |
# Update all dependencies to latest compatible versions
cargo update
# Check for outdated dependencies
cargo install cargo-outdated
cargo outdated --root-deps-only > outdated_deps.txt
if [[ -s outdated_deps.txt ]]; then
echo "Outdated dependencies found:"
cat outdated_deps.txt
# Create a summary for the PR
echo "## Rust Dependencies Update" > update_summary.md
echo "" >> update_summary.md
echo "The following dependencies have been updated:" >> update_summary.md
echo "" >> update_summary.md
echo '```' >> update_summary.md
cat outdated_deps.txt >> update_summary.md
echo '```' >> update_summary.md
else
echo "No outdated dependencies found"
echo "## Rust Dependencies Update" > update_summary.md
echo "" >> update_summary.md
echo "All dependencies are up to date." >> update_summary.md
fi
- name: Run tests with updated dependencies
run: cargo test --lib
- name: Check if changes were made
id: changes
run: |
if git diff --quiet Cargo.lock; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update Rust dependencies'
title: 'chore: Update Rust dependencies'
body-path: update_summary.md
branch: automated/update-rust-dependencies
delete-branch: true
labels: |
dependencies
automated
update_node_dependencies:
name: Update Node.js Dependencies
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install npm-check-updates
run: npm install -g npm-check-updates
- name: Update dependencies
working-directory: vscode-extension
run: |
# Check for outdated dependencies
ncu > outdated_deps.txt || true
# Update dependencies
ncu -u
npm install
# Create summary
echo "## Node.js Dependencies Update" > ../update_summary_node.md
echo "" >> ../update_summary_node.md
if [[ -s outdated_deps.txt ]]; then
echo "The following dependencies have been updated:" >> ../update_summary_node.md
echo "" >> ../update_summary_node.md
echo '```' >> ../update_summary_node.md
cat outdated_deps.txt >> ../update_summary_node.md
echo '```' >> ../update_summary_node.md
else
echo "All dependencies are up to date." >> ../update_summary_node.md
fi
- name: Run tests with updated dependencies
working-directory: vscode-extension
run: |
npm run compile
npm test || true # Don't fail if tests aren't fully implemented
- name: Check if changes were made
id: changes
run: |
if git diff --quiet vscode-extension/package.json vscode-extension/package-lock.json; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.changes.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore: update Node.js dependencies'
title: 'chore: Update Node.js dependencies'
body-path: update_summary_node.md
branch: automated/update-node-dependencies
delete-branch: true
labels: |
dependencies
automated
security_audit:
name: Security Audit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Rust Security Audit
uses: rustsec/audit-check@v2.0.0
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install Node.js dependencies
working-directory: vscode-extension
run: npm install
- name: Node.js Security Audit
working-directory: vscode-extension
run: |
npm audit --audit-level=moderate || {
echo "Security vulnerabilities found in Node.js dependencies"
npm audit --audit-level=moderate --json > audit_results.json
# Create issue if vulnerabilities found
echo "## Security Vulnerabilities Found" > security_report.md
echo "" >> security_report.md
echo "The following security vulnerabilities were found in Node.js dependencies:" >> security_report.md
echo "" >> security_report.md
echo '```json' >> security_report.md
cat audit_results.json >> security_report.md
echo '```' >> security_report.md
echo "" >> security_report.md
echo "Please review and update the affected dependencies." >> security_report.md
# This will be handled by the issue creation step
exit 1
}
- name: Create security issue
if: failure()
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'security: address dependency vulnerabilities'
title: 'security: Address dependency vulnerabilities'
body-path: vscode-extension/security_report.md
branch: automated/security-fixes
delete-branch: true
labels: |
security
dependencies
automated
check_licenses:
name: Check Licenses
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install cargo-license
run: cargo install cargo-license
- name: Check Rust licenses
run: |
echo "## Rust Dependencies Licenses" > license_report.md
echo "" >> license_report.md
echo '```' >> license_report.md
cargo license >> license_report.md
echo '```' >> license_report.md
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Install license-checker
run: npm install -g license-checker
- name: Check Node.js licenses
working-directory: vscode-extension
run: |
npm install
echo "" >> ../license_report.md
echo "## Node.js Dependencies Licenses" >> ../license_report.md
echo "" >> ../license_report.md
echo '```' >> ../license_report.md
license-checker --summary >> ../license_report.md
echo '```' >> ../license_report.md
- name: Upload license report
uses: actions/upload-artifact@v4
with:
name: license-report
path: license_report.md
retention-days: 30
dependency_graph:
name: Update Dependency Graph
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Submit dependency graph
uses: github/dependency-submission-action@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}