File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -28,14 +28,29 @@ jobs:
2828 with :
2929 script : |
3030 const fs = require('fs');
31+ const reportTitle = 'Broken Links Report';
32+ const openIssues = await github.paginate(
33+ github.rest.issues.listForRepo,
34+ {
35+ owner: context.repo.owner,
36+ repo: context.repo.repo,
37+ state: 'open',
38+ per_page: 100
39+ }
40+ );
41+
42+ if (openIssues.some(issue =>
43+ !issue.pull_request && issue.title === reportTitle
44+ )) {
45+ core.info(`An open "${reportTitle}" issue already exists; skipping.`);
46+ return;
47+ }
3148
32- // Read the markdown file
33- // Ensure the path is correct relative to the workspace root
3449 const reportBody = fs.readFileSync('./lychee/out.md', 'utf8');
3550
3651 await github.rest.issues.create({
3752 owner: context.repo.owner,
3853 repo: context.repo.repo,
39- title: 'Broken Links Report' ,
54+ title: reportTitle ,
4055 body: reportBody
4156 });
You can’t perform that action at this time.
0 commit comments