Skip to content

Commit 12f2a87

Browse files
committed
log duplicated run link
1 parent e1be5ba commit 12f2a87

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/approval-dedupe.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ on:
5959
prev_conclusion:
6060
description: If mode == mirror_completed, the conclusion to mirror
6161
value: ${{ jobs.gate.outputs.prev_conclusion }}
62+
prev_run_id:
63+
description: If mode == mirror_completed, the prior run id being mirrored
64+
value: ${{ jobs.gate.outputs.prev_run_id }}
6265

6366
permissions:
6467
actions: read
@@ -72,6 +75,7 @@ jobs:
7275
mode: ${{ steps.check.outputs.mode }}
7376
target_run_id: ${{ steps.check.outputs.target_run_id }}
7477
prev_conclusion: ${{ steps.check.outputs.prev_conclusion }}
78+
prev_run_id: ${{ steps.check.outputs.prev_run_id }}
7579
steps:
7680
- name: Determine mode
7781
id: check
@@ -117,6 +121,7 @@ jobs:
117121
if (active) {
118122
core.setOutput('mode', 'wait')
119123
core.setOutput('target_run_id', String(active.id))
124+
core.setOutput('prev_run_id', String(active.id))
120125
return
121126
}
122127
@@ -126,6 +131,7 @@ jobs:
126131
if (completed) {
127132
core.setOutput('mode', 'mirror_completed')
128133
core.setOutput('prev_conclusion', completed.conclusion || '')
134+
core.setOutput('prev_run_id', String(completed.id))
129135
return
130136
}
131137
@@ -174,6 +180,7 @@ jobs:
174180
- name: Mirror result
175181
run: |
176182
echo "Previous conclusion: ${{ needs.gate.outputs.prev_conclusion }}"
183+
echo "Mirroring workflow run: https://github.com/${{ github.repository }}/actions/runs/${{ needs.gate.outputs.prev_run_id }}"
177184
if [ "${{ needs.gate.outputs.prev_conclusion }}" != "success" ]; then
178185
echo "Mirroring failure"
179186
exit 1

0 commit comments

Comments
 (0)