-
Notifications
You must be signed in to change notification settings - Fork 445
87 lines (77 loc) · 2.75 KB
/
Copy pathcheck-tools-links.yml
File metadata and controls
87 lines (77 loc) · 2.75 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
name: Check tools links
# Network-bound drift guard for tools/tools.json. Pings each tool's primary URL
# (and homepage, as a non-fatal warning) so a maintainer pass can re-verify or
# retire entries whose upstream moved. Not part of the blocking validate gate.
on:
schedule:
- cron: "0 8 1 * *" # 08:00 UTC on the 1st of each month
workflow_dispatch: {}
permissions:
contents: read
issues: write
jobs:
tools-links:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: "3.11"
- name: Check tools-catalog links
id: check
run: |
set +e
make tools-links
rc=$?
set -e
echo "exit=$rc" >> "$GITHUB_OUTPUT"
- name: Build link-triage note
if: steps.check.outputs.exit != '0'
run: python3 scripts/build-link-triage.py --out docs/LINK_TRIAGE.md
- name: Upload tools link-check report
if: always()
uses: actions/upload-artifact@v7
with:
name: tools-link-check
path: catalog/tools-link-check.json
- name: Upload triage artifact
if: always()
uses: actions/upload-artifact@v7
with:
name: tools-link-triage
path: docs/LINK_TRIAGE.md
triage-issue:
if: failure()
needs: tools-links
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- name: Open tools-link-triage issue
uses: actions/github-script@v9
with:
script: |
const title = `[link-triage] Tools-catalog link check failed (${new Date().toISOString().slice(0,10)})`;
const body = require('fs').readFileSync('docs/LINK_TRIAGE.md', 'utf8');
const marker = '[link-triage] Tools-catalog link check failed';
const { data } = await github.rest.issues.listForRepo({
owner: context.repo.owner, repo: context.repo.repo, state: 'open', per_page: 20
});
const existing = data.find(i => i.title.startsWith(marker));
if (existing) {
await github.rest.issues.createComment({
owner: context.repo.owner, repo: context.repo.repo,
issue_number: existing.number, body
});
core.info(`updated existing triage issue #${existing.number}`);
} else {
const issue = await github.rest.issues.create({
owner: context.repo.owner, repo: context.repo.repo,
title, body, labels: ['link-triage']
});
core.info(`opened new triage issue #${issue.data.number}`);
}