-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (58 loc) · 2.23 KB
/
check_vendordeps.yml
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
name: Check Dependencies
on:
schedule:
- cron: '0 12 */2 * *' # Run at noon UTC every other day
workflow_dispatch: # Allow manual triggers
jobs:
check-updates:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: pip install requests packaging
- name: Check for updates
id: check
run: python .github/scripts/check_vendordeps.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Issue for Updates
if: steps.check.outputs.has_updates == 'true'
uses: actions/github-script@v6
with:
script: |
try {
const updates = JSON.parse('${{ steps.check.outputs.updates }}');
let body = '# Dependency Updates Available\n\n';
for (const update of updates) {
body += `### ${update.name}\n`;
body += `- Current version: ${update.current}\n`;
body += `- Latest version: ${update.latest}\n`;
body += `- Source: ${update.source}\n`;
if (update.url) {
body += `- [View Release](${update.url})\n`;
}
if (update.name === 'WPILib') {
body += '\n⚠️ **Note**: Please use WPILib VS Code tools for actual updates\n';
if (update.notes) {
body += '\n<details><summary>Release Notes</summary>\n\n';
body += update.notes;
body += '\n</details>\n';
}
}
body += '\n';
}
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: '🔄 Dependency Updates Available',
body: body,
labels: ['dependencies']
});
} catch (error) {
console.error('Error processing updates:', error);
core.setFailed(error.message);
}