1- # Add this to the supabase-js repository as .github/workflows/external-test.yml
21name : External Dependency Test
32
43on :
5- repository_dispatch :
6- types : [test-with-preview]
4+ workflow_dispatch :
5+ inputs :
6+ triggering_repo :
7+ description : ' Repository that triggered this test'
8+ required : true
9+ type : string
10+ triggering_pr :
11+ description : ' PR number from triggering repository'
12+ required : true
13+ type : string
14+ preview_url :
15+ description : ' Preview package URL'
16+ required : true
17+ type : string
18+ package_name :
19+ description : ' Package name being tested'
20+ required : true
21+ type : string
22+ triggering_sha :
23+ description : ' SHA from triggering repository'
24+ required : true
25+ type : string
26+ triggering_ref :
27+ description : ' Git ref from triggering repository'
28+ required : true
29+ type : string
730
831env :
932 NODE_VERSION : ' 20'
4164 - name : Install preview dependency
4265 run : |
4366 # Install the preview package
44- PREVIEW_PACKAGE="${{ github.event.client_payload .preview_url }}"
67+ PREVIEW_PACKAGE="${{ inputs .preview_url }}"
4568 echo "Installing preview package: $PREVIEW_PACKAGE"
4669 npm install "$PREVIEW_PACKAGE" --no-save
4770
86109 with :
87110 github-token : ${{ secrets.GITHUB_TOKEN }}
88111 script : |
89- const payload = ${{ toJson(github.event.client_payload) }};
90112 const typeCheckResult = '${{ steps.type-check.outputs.result }}' || 'failure';
91113 const unitTestResult = '${{ steps.unit-tests.outputs.result }}' || 'failure';
92114 const integrationTestResult = '${{ steps.integration-tests.outputs.result }}' || 'failure';
@@ -102,16 +124,16 @@ jobs:
102124
103125 **Overall Status: ${overallStatus}**
104126
105- Tests triggered by preview release of \`${payload .package_name}\`
127+ Tests triggered by preview release of \`${{ inputs .package_name } }\`
106128
107129 | Test Suite | Result |
108130 |------------|--------|
109131 | Type Check | ${typeCheckResult === 'success' ? '✅ PASSED' : '❌ FAILED'} |
110132 | Unit Tests | ${unitTestResult === 'success' ? '✅ PASSED' : '❌ FAILED'} |
111133 | Integration Tests | ${integrationTestResult === 'success' ? '✅ PASSED' : '❌ FAILED'} |
112134
113- **Preview Package:** \`${payload .preview_url}\`
114- **Commit:** [\`${payload .triggering_sha.substring(0, 7)} \`](https://github.com/supabase/${payload .triggering_repo} /commit/${payload .triggering_sha})
135+ **Preview Package:** \`${{ inputs .preview_url } }\`
136+ **Commit:** [\`${{ inputs .triggering_sha }} \`](https://github.com/supabase/${{ inputs .triggering_repo }} /commit/${{ inputs .triggering_sha } })
115137
116138 ${allPassed ?
117139 '🎉 All tests passed! This preview release is compatible with supabase-js.' :
@@ -127,8 +149,8 @@ jobs:
127149 try {
128150 await github.rest.issues.createComment({
129151 owner: 'supabase',
130- repo: payload .triggering_repo,
131- issue_number: parseInt(payload .triggering_pr),
152+ repo: '${{ inputs .triggering_repo }}' ,
153+ issue_number: parseInt('${{ inputs .triggering_pr }}' ),
132154 body: body
133155 });
134156 console.log('Successfully posted comment to PR');
0 commit comments