Skip to content

Commit ee9dceb

Browse files
committed
update
1 parent 9d6548b commit ee9dceb

4 files changed

Lines changed: 28 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v4
1616
- run: |
1717
cmake -S . -B build
18-
echo "#cppwarningnotifier commit=${{ github.sha }}" >> compilation.log
18+
echo "#cppwarningnotifier { run_id: ${{ github.run_id }} }" >> compilation.log
1919
cmake --build build >> compilation.log 2>&1
2020
- uses: actions/upload-artifact@v4
2121
with:

dist/index.js

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ for (const file of readdirRecursively(".")) {
5151
const match_result = compilation_output.match(regex);
5252

5353
if (match_result && match_result.length > 0) {
54+
const prefix = "#cppwarningnotifier";
55+
const firstLine = compilation_output.split("\n")[0];
56+
if (firstLine.startsWith(prefix)) {
57+
const { run_id } = JSON.parse(firstLine.substring(prefix.length));
58+
const { data: jobs } = await octokit.rest.actions.listJobsForWorkflowRun({
59+
owner,
60+
repo,
61+
run_id,
62+
});
63+
console.log(
64+
"jobs: ",
65+
jobs.jobs.map((job) => job.html_url)
66+
);
67+
}
68+
5469
const append_string = `detected warnings in the compilation output: <details><summary>compilation output</summary>\n\n\`\`\`\n${compilation_output}\n\`\`\`\n</details>\n`;
5570
if (body) {
5671
body += append_string;

0 commit comments

Comments
 (0)