22name : External Dependency Test
33
44on :
5- repository_dispatch :
6- types : [test-with-preview]
5+ workflow_dispatch :
6+ inputs :
7+ triggering_repo :
8+ description : ' Repository that triggered this test'
9+ required : true
10+ type : string
11+ triggering_pr :
12+ description : ' PR number from triggering repository'
13+ required : true
14+ type : string
15+ preview_url :
16+ description : ' Preview package URL'
17+ required : true
18+ type : string
19+ package_name :
20+ description : ' Package name being tested'
21+ required : true
22+ type : string
23+ triggering_sha :
24+ description : ' SHA from triggering repository'
25+ required : true
26+ type : string
27+ triggering_ref :
28+ description : ' Git ref from triggering repository'
29+ required : true
30+ type : string
731
832env :
933 NODE_VERSION : ' 20'
4165 - name : Install preview dependency
4266 run : |
4367 # Install the preview package
44- PREVIEW_PACKAGE="${{ github.event.client_payload .preview_url }}"
68+ PREVIEW_PACKAGE="${{ inputs .preview_url }}"
4569 echo "Installing preview package: $PREVIEW_PACKAGE"
4670 npm install "$PREVIEW_PACKAGE" --no-save
4771
86110 with :
87111 github-token : ${{ secrets.GITHUB_TOKEN }}
88112 script : |
89- const payload = ${{ toJson(github.event.client_payload) }};
90113 const typeCheckResult = '${{ steps.type-check.outputs.result }}' || 'failure';
91114 const unitTestResult = '${{ steps.unit-tests.outputs.result }}' || 'failure';
92115 const integrationTestResult = '${{ steps.integration-tests.outputs.result }}' || 'failure';
@@ -102,16 +125,16 @@ jobs:
102125
103126 **Overall Status: ${overallStatus}**
104127
105- Tests triggered by preview release of \`${payload .package_name}\`
128+ Tests triggered by preview release of \`${{ inputs .package_name } }\`
106129
107130 | Test Suite | Result |
108131 |------------|--------|
109132 | Type Check | ${typeCheckResult === 'success' ? '✅ PASSED' : '❌ FAILED'} |
110133 | Unit Tests | ${unitTestResult === 'success' ? '✅ PASSED' : '❌ FAILED'} |
111134 | Integration Tests | ${integrationTestResult === 'success' ? '✅ PASSED' : '❌ FAILED'} |
112135
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})
136+ **Preview Package:** \`${{ inputs .preview_url } }\`
137+ **Commit:** [\`${{ inputs .triggering_sha }} \`](https://github.com/supabase/${{ inputs .triggering_repo }} /commit/${{ inputs .triggering_sha } })
115138
116139 ${allPassed ?
117140 '🎉 All tests passed! This preview release is compatible with supabase-js.' :
@@ -127,8 +150,8 @@ jobs:
127150 try {
128151 await github.rest.issues.createComment({
129152 owner: 'supabase',
130- repo: payload .triggering_repo,
131- issue_number: parseInt(payload .triggering_pr),
153+ repo: '${{ inputs .triggering_repo }}' ,
154+ issue_number: parseInt('${{ inputs .triggering_pr }}' ),
132155 body: body
133156 });
134157 console.log('Successfully posted comment to PR');
0 commit comments