@@ -43,30 +43,27 @@ jobs:
43
43
console.log('No associated PR found');
44
44
}
45
45
46
- # Only continue if we found a PR and the workflow succeeded
47
- - name : Download canary info
46
+ # Extract canary info from the workflow run
47
+ - name : Extract canary info
48
48
if : ${{ steps.pr-info.outputs.found == 'true' && github.event.workflow_run.conclusion == 'success' }}
49
- uses : actions/download-artifact@v4
49
+ id : canary-info
50
+ uses : actions/github-script@v7
50
51
with :
51
- name : canary-info
52
- path : canary-info/
53
- run-id : ${{ github.event.workflow_run.id }}
54
- continue-on-error : true
52
+ script : |
53
+ const workflowRun = context.payload.workflow_run;
55
54
56
- - name : Read canary info
57
- if : ${{ steps.pr-info.outputs.found == 'true' && github.event.workflow_run.conclusion == 'success' }}
58
- id : canary-info
59
- run : |
60
- if [ -f "canary-info/canary-tags.txt" ]; then
61
- # Read the first tag (DockerHub) from the tags
62
- FIRST_TAG=$(head -n1 canary-info/canary-tags.txt)
63
- echo "tag=$FIRST_TAG" >> $GITHUB_OUTPUT
64
- echo "found=true" >> $GITHUB_OUTPUT
65
- echo "commit-sha=$(cat canary-info/commit-sha.txt)" >> $GITHUB_OUTPUT
66
- else
67
- echo "found=false" >> $GITHUB_OUTPUT
68
- fi
69
- continue-on-error : true
55
+ // Extract PR number from the branch name or workflow run
56
+ const prNumber = '${{ steps.pr-info.outputs.pr_number }}';
57
+ const commitSha = workflowRun.head_sha;
58
+
59
+ // Generate the canary tag based on the pattern used in canary-deploy.yml
60
+ const canaryTag = `supabase/postgres-meta:canary-pr-${prNumber}-${commitSha}`;
61
+
62
+ core.setOutput('tag', canaryTag);
63
+ core.setOutput('found', 'true');
64
+ core.setOutput('commit-sha', commitSha);
65
+
66
+ console.log(`Generated canary tag: ${canaryTag}`);
70
67
71
68
# Find existing comment
72
69
- name : Find existing comment
0 commit comments