-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
21 lines (21 loc) · 804 Bytes
/
index.js
File metadata and controls
21 lines (21 loc) · 804 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { request } from 'https://cdn.skypack.dev/@octokit/request';
async function setACrossGitVersion() {
const content = await request('GET /repos/{owner}/{repo}/actions/artifacts', {
owner: 'Arktoria',
repo: 'ACross'
});
const pkgMap = new Map();
for (const pkg of content.data.artifacts) {
for (const pkgType of ['msvc', 'mingw-w64', 'archlinux']) {
if (pkg.name !== '' && pkg.name.includes(pkgType) && !pkgMap.has(pkgType)) {
pkgMap.set(pkgType, true);
const verElement = document.getElementById(`across-git-${pkgType}`);
if (verElement != null) {
verElement.textContent = pkg.name;
}
break;
}
}
}
}
setACrossGitVersion();