Skip to content

Commit 677dbb3

Browse files
committed
TEST
1 parent 00e3470 commit 677dbb3

5 files changed

Lines changed: 26 additions & 46 deletions

File tree

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,5 @@ jobs:
5050
with:
5151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5252
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
53+
STEP_REGEX: build-.*
54+
JOB_REGEX: .*\((?:(.*?),)+\)

action.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ inputs:
99
PRIVATE_KEY:
1010
description: Private key for GitHub App
1111
required: true
12+
JOB_REGEX:
13+
description: regex for job name parsing
14+
required: true
15+
STEP_REGEX:
16+
description: regex for step name filtering
1217

1318
runs:
14-
using: 'node20'
15-
main: 'dist/index.js'
19+
using: "node20"
20+
main: "dist/index.js"

dist/index.js

Lines changed: 8 additions & 20 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: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ if (!process.env.GITHUB_REF?.startsWith("refs/pull/")) {
99
const [owner, repo] = process.env.GITHUB_REPOSITORY?.split("/")!;
1010
const pull_request_number = parseInt(process.env.GITHUB_REF?.split("/")[2]!);
1111

12+
const job_regex = process.env.INPUT_JOB_REGEX!;
13+
const step_regex = process.env.INPUT_STEP_REGEX!;
14+
1215
const appId = 1230093;
1316
const privateKey = process.env.INPUT_PRIVATE_KEY!;
1417

@@ -71,7 +74,7 @@ for (const file of readdirRecursively(".")) {
7174
const step = job.steps![i];
7275
console.log(i, step);
7376
if (
74-
step.name.toLowerCase().match(/build( \(.+\))?/) &&
77+
step.name.toLowerCase().match(step_regex) &&
7578
step.status === "completed" &&
7679
step.conclusion === "success"
7780
) {
@@ -86,34 +89,16 @@ for (const file of readdirRecursively(".")) {
8689

8790
console.log(`job name is "${job.name}"`);
8891

89-
const jobMatch = job.name.match(/.+\((.+?)\)/);
92+
const jobMatch = job.name.match(job_regex);
93+
9094
if (!jobMatch || jobMatch.length === 0) {
9195
console.log("job match fail");
9296
continue;
9397
}
9498

95-
const info = jobMatch[1].split(", ");
96-
97-
console.log("info: ", info);
98-
99-
const osName = info[0];
100-
const osVersion = info[1];
101-
const buildType = info[2];
102-
const cppVersion = info[3];
103-
// const boostVersion = info[4];
104-
const compilerName = info[5];
105-
const compilerVersion = info[6];
106-
// const compilerExecutable = info[7];
107-
108-
const url = `https://github.com/${owner}/${repo}/actions/runs/${runId}/job/${jobId}#step:${stepId}:1`;
99+
console.log(jobMatch);
109100

110-
matrix[osName + osVersion] ??= {};
111-
matrix[osName + osVersion][compilerName] ??= {};
112-
matrix[osName + osVersion][compilerName][compilerVersion] ??= {};
113-
matrix[osName + osVersion][compilerName][compilerVersion][buildType] ??= [];
114-
matrix[osName + osVersion][compilerName][compilerVersion][buildType][
115-
(parseInt(cppVersion) - 23) / 3
116-
] ??= `<a href="${url}">${compileResult}</a>`;
101+
// const url = `https://github.com/${owner}/${repo}/actions/runs/${runId}/job/${jobId}#step:${stepId}:1`;
117102
}
118103

119104
console.log(matrix);

0 commit comments

Comments
 (0)