Skip to content

Commit b21badf

Browse files
committed
rework get job url in indy and latest tests
1 parent 23f6073 commit b21badf

File tree

3 files changed

+31
-17
lines changed

3 files changed

+31
-17
lines changed

.github/workflows/build-common.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -290,21 +290,14 @@ 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-
301293
- name: Get current job url
302294
id: jobs
303295
if: ${{ !cancelled() }}
304296
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
305297
env:
306298
matrix: ${{ toJson(matrix) }}
307299
with:
300+
result-encoding: string
308301
script: |
309302
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
310303
owner: context.repo.owner,
@@ -321,7 +314,6 @@ jobs:
321314
env:
322315
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
323316
JOB_URL: ${{ steps.jobs.outputs.result }}
324-
# JOB_URL: ${{ steps.jobs.outputs.html_url }}
325317
run: |
326318
if [ -s build-scan.txt ]; then
327319
export BUILD_SCAN_URL=$(cat build-scan.txt)

.github/workflows/reusable-test-indy.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,29 @@ jobs:
8888
run: cat build-scan.txt
8989

9090
- name: Get current job url
91-
uses: Tiryoh/gha-jobid-action@be260d8673c9211a84cdcf37794ebd654ba81eef # v1.4.0
9291
id: jobs
9392
if: ${{ !cancelled() }}
93+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
94+
env:
95+
matrix: ${{ toJson(matrix) }}
9496
with:
95-
job_name: "test-indy / testIndy${{ matrix.test-partition }}"
96-
per_page: 100 # input matrix size here if it is larger than 30
97+
result-encoding: string
98+
script: |
99+
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
100+
owner: context.repo.owner,
101+
repo: context.repo.repo,
102+
run_id: context.runId,
103+
per_page: 100
104+
});
105+
const matrix = JSON.parse(process.env.matrix);
106+
const job_name = `test-indy / testIndy${ matrix['test-partition'] }`;
107+
return workflow_run.jobs.find((job) => job.name === job_name).html_url;
97108
98109
- name: Flaky test report
99110
if: ${{ !cancelled() }}
100111
env:
101112
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
102-
JOB_URL: ${{ steps.jobs.outputs.html_url }}
113+
JOB_URL: ${{ steps.jobs.outputs.result }}
103114
run: |
104115
if [ -s build-scan.txt ]; then
105116
export BUILD_SCAN_URL=$(cat build-scan.txt)

.github/workflows/reusable-test-latest-deps.yml

+15-4
Original file line numberDiff line numberDiff line change
@@ -86,18 +86,29 @@ jobs:
8686
run: cat build-scan.txt
8787

8888
- name: Get current job url
89-
uses: Tiryoh/gha-jobid-action@be260d8673c9211a84cdcf37794ebd654ba81eef # v1.4.0
9089
id: jobs
9190
if: ${{ !cancelled() }}
91+
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
92+
env:
93+
matrix: ${{ toJson(matrix) }}
9294
with:
93-
job_name: "test-latest-deps / testLatestDeps${{ matrix.test-partition }}"
94-
per_page: 100 # input matrix size here if it is larger than 30
95+
result-encoding: string
96+
script: |
97+
const { data: workflow_run } = await github.rest.actions.listJobsForWorkflowRun({
98+
owner: context.repo.owner,
99+
repo: context.repo.repo,
100+
run_id: context.runId,
101+
per_page: 100
102+
});
103+
const matrix = JSON.parse(process.env.matrix);
104+
const job_name = `test-latest-deps / testLatestDeps${ matrix['test-partition'] }`;
105+
return workflow_run.jobs.find((job) => job.name === job_name).html_url;
95106
96107
- name: Flaky test report
97108
if: ${{ !cancelled() }}
98109
env:
99110
FLAKY_TEST_REPORTER_ACCESS_KEY: ${{ secrets.FLAKY_TEST_REPORTER_ACCESS_KEY }}
100-
JOB_URL: ${{ steps.jobs.outputs.html_url }}
111+
JOB_URL: ${{ steps.jobs.outputs.result }}
101112
run: |
102113
if [ -s build-scan.txt ]; then
103114
export BUILD_SCAN_URL=$(cat build-scan.txt)

0 commit comments

Comments
 (0)