Skip to content

Commit 8644110

Browse files
authored
fix step index calculation (#11)
1 parent 893d4b4 commit 8644110

4 files changed

Lines changed: 35 additions & 6 deletions

File tree

.github/workflows/test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ jobs:
2828

2929
steps:
3030
- uses: actions/checkout@v4
31-
- run: |
32-
cmake -S . -B build
33-
cmake --build build >> compilation.log 2>&1
31+
- name: configure
32+
run: cmake -S. -Bbuild
33+
- name: build-${{ matrix.os.name }}
34+
run: cmake --build build >> compilation.log 2>&1
3435
- uses: qoomon/actions--context@v4
3536
id: context
3637
- uses: actions/upload-artifact@v4

dist/index.js

Lines changed: 14 additions & 1 deletion
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: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ for (const file of readdirRecursively(".")) {
4646

4747
const runId = artifactMatch[1];
4848
const jobId = artifactMatch[2];
49-
const stepId = artifactMatch[3];
49+
// const stepId = artifactMatch[3];
5050

5151
console.log("found", file, "detecting warnings...");
5252

@@ -68,6 +68,21 @@ for (const file of readdirRecursively(".")) {
6868
job_id: parseInt(jobId),
6969
});
7070

71+
const stepId = (() => {
72+
let i = 0;
73+
while (i < job.steps!.length) {
74+
const step = job.steps![i];
75+
console.log(i, step);
76+
if (step.name.startsWith("build") && step.status == "completed") {
77+
break;
78+
}
79+
++i;
80+
}
81+
return i + 1;
82+
})();
83+
84+
console.log(`stepId is ${stepId}`);
85+
7186
console.log(`job name is "${job.name}"`);
7287

7388
// build (ubuntu, 24.04, Release, 20, 1.86.0, GNU, 13, g++-13)

0 commit comments

Comments
 (0)