Skip to content

Commit 2b953a7

Browse files
committed
Update redirect page
1 parent 55f6648 commit 2b953a7

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

index.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>Redirecting to Latest Scan Results...</title>
5+
<script>
6+
async function redirectToLatestRun() {
7+
try {
8+
const response = await fetch('https://api.github.com/repos/blackducksca-user-guide/automatic-fixpr/actions/workflows/nodejs-npm.yml/runs');
9+
const data = await response.json();
10+
if (data.workflow_runs && data.workflow_runs.length > 0) {
11+
window.location.href = data.workflow_runs[0].html_url;
12+
} else {
13+
window.location.href = 'https://github.com/blackducksca-user-guide/automatic-fixpr/actions';
14+
}
15+
} catch (error) {
16+
window.location.href = 'https://github.com/blackducksca-user-guide/automatic-fixpr/actions';
17+
}
18+
}
19+
redirectToLatestRun();
20+
</script>
21+
</head>
22+
<body>
23+
<p>Redirecting to latest scan results...</p>
24+
</body>
25+
</html>

0 commit comments

Comments
 (0)