File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -45,12 +45,20 @@ jobs:
4545 });
4646
4747 const matchingRuns = data.workflow_runs
48- .filter((run) => run.ref === targetRef)
48+ .filter((run) => {
49+ if (typeof run.head_branch === 'string' && run.head_branch.length > 0) {
50+ return run.head_branch === targetTag;
51+ }
52+
53+ return run.head_sha === targetSha;
54+ })
4955 .sort((a, b) => new Date(b.created_at).getTime() - new Date(a.created_at).getTime());
5056
5157 if (matchingRuns.length > 0) {
5258 const run = matchingRuns[0];
53- core.info(`Found CI run #${run.run_number}: status=${run.status}, conclusion=${run.conclusion ?? 'n/a'}`);
59+ core.info(
60+ `Found CI run #${run.run_number}: head_branch=${run.head_branch ?? 'n/a'}, status=${run.status}, conclusion=${run.conclusion ?? 'n/a'}`
61+ );
5462
5563 if (run.status === 'completed') {
5664 if (run.conclusion === 'success') {
You can’t perform that action at this time.
0 commit comments