Skip to content

Commit a8d4f26

Browse files
committed
try a different way for getting the job url
1 parent ae0a6f1 commit a8d4f26

File tree

2 files changed

+24
-4
lines changed

2 files changed

+24
-4
lines changed

.github/workflows/build-common.yml

+22-4
Original file line numberDiff line numberDiff line change
@@ -290,19 +290,37 @@ jobs:
290290
if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}
291291
run: cat build-scan.txt
292292

293+
# - name: Get current job url
294+
# uses: Tiryoh/gha-jobid-action@be260d8673c9211a84cdcf37794ebd654ba81eef # v1.4.0
295+
# id: jobs
296+
# if: ${{ !cancelled() }}
297+
# with:
298+
# job_name: "common / test${{ matrix.test-partition }} (${{ matrix.test-java-version }}, ${{ matrix.vm }})"
299+
# per_page: 100 # input matrix size here if it is larger than 30
300+
293301
- name: Get current job url
294-
uses: Tiryoh/gha-jobid-action@be260d8673c9211a84cdcf37794ebd654ba81eef # v1.4.0
295302
id: jobs
296303
if: ${{ !cancelled() }}
304+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
305+
env:
306+
matrix: ${{ toJson(matrix) }}
297307
with:
298-
job_name: "common / test${{ matrix.test-partition }} (${{ matrix.test-java-version }}, ${{ matrix.vm }})"
299-
per_page: 100 # input matrix size here if it is larger than 30
308+
script: |
309+
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
310+
owner: context.repo.owner,
311+
repo: context.repo.repo,
312+
run_id: context.runId
313+
});
314+
const matrix = JSON.parse(process.env.matrix);
315+
const job_name = `common / test${ matrix.test-partition } (${ matrix.test-java-version }, ${ matrix.vm })`;
316+
return workflow_run.jobs.find((job) => job.name === job_name).html_url;
300317
301318
- name: Flaky test report
302319
if: ${{ !cancelled() }}
303320
env:
304321
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
305-
JOB_URL: ${{ steps.jobs.outputs.html_url }}
322+
JOB_URL: ${{ steps.jobs.outputs.result }}
323+
# JOB_URL: ${{ steps.jobs.outputs.html_url }}
306324
run: |
307325
if [ -s build-scan.txt ]; then
308326
export BUILD_SCAN_URL=$(cat build-scan.txt)

test-report/src/main/java/io/opentelemetry/instrumentation/testreport/FlakyTestReporter.java

+2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,8 @@ public static void main(String... args) throws Exception {
275275
String accessKey = System.getProperty("googleSheetsAccessKey");
276276
String buildScanUrl = System.getProperty("buildScanUrl");
277277
String jobUrl = System.getProperty("jobUrl");
278+
System.err.println("buildScanUrl " + buildScanUrl);
279+
System.err.println("jobUrl " + jobUrl);
278280
if (accessKey != null && !accessKey.isEmpty()) {
279281
reporter.report(accessKey, buildScanUrl, jobUrl);
280282
}

0 commit comments

Comments
 (0)