Skip to content

Commit a1ec246

Browse files
committed
Add more debug output
1 parent dbafdcc commit a1ec246

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

code-scanning-export/dist/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29284,10 +29284,13 @@ const path = __importStar(__nccwpck_require__(1017));
2928429284
*/
2928529285
async function run() {
2928629286
const repositoryInfo = getRepositoryInfo();
29287-
const alerts = await (0, api_1.getAlerts)(repositoryInfo.owner, repositoryInfo.repo, core.getInput('ref'), core.getInput('token'));
29287+
const ref = core.getInput('ref');
29288+
core.debug(`Fetching open and dismissed alerts for repository ${repositoryInfo.owner}/${repositoryInfo.repo}#${ref}`);
29289+
const alerts = await (0, api_1.getAlerts)(repositoryInfo.owner, repositoryInfo.repo, ref, core.getInput('token'));
29290+
core.debug(`Found ${alerts.length} alerts, processing now...`);
2928829291
const sarifReport = (0, sarif_1.createSarifReport)(alerts);
29289-
const filePath = path.join(process.cwd(), core.getInput('file'));
29290-
core.debug(`Writing to file ${filePath}`);
29292+
const filePath = path.join(process.cwd(), core.getInput('output-file'));
29293+
core.debug(`Processing done, writing report to file ${filePath}`);
2929129294
fs.writeFileSync(filePath, JSON.stringify(sarifReport), {});
2929229295
}
2929329296
exports.run = run;

code-scanning-export/src/main.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,23 @@ type RepositoryInfo = {
1616
*/
1717
export async function run(): Promise<void> {
1818
const repositoryInfo = getRepositoryInfo()
19+
const ref = core.getInput('ref');
20+
21+
core.debug(`Fetching open and dismissed alerts for repository ${repositoryInfo.owner}/${repositoryInfo.repo}#${ref}`)
1922

2023
const alerts = await getAlerts(
2124
repositoryInfo.owner,
2225
repositoryInfo.repo,
23-
core.getInput('ref'),
26+
ref,
2427
core.getInput('token')
2528
)
2629

30+
core.debug(`Found ${alerts.length} alerts, processing now...`)
31+
2732
const sarifReport = createSarifReport(alerts)
28-
const filePath = path.join(process.cwd(), core.getInput('file'))
29-
core.debug(`Writing to file ${filePath}`)
33+
const filePath = path.join(process.cwd(), core.getInput('output-file'))
34+
35+
core.debug(`Processing done, writing report to file ${filePath}`)
3036

3137
fs.writeFileSync(filePath, JSON.stringify(sarifReport), {})
3238
}

0 commit comments

Comments
 (0)