|
15 | 15 | description: 'Target branch for supabase-js tests' |
16 | 16 | type: string |
17 | 17 | default: 'master' |
18 | | - |
| 18 | + |
19 | 19 | # Push to master - only when source code changes |
20 | 20 | push: |
21 | 21 | branches: |
|
25 | 25 | - 'package.json' |
26 | 26 | - 'package-lock.json' |
27 | 27 | - 'tsconfig.json' |
28 | | - |
| 28 | + |
29 | 29 | # PR triggers - only when labeled |
30 | | - pull_request: |
| 30 | + # Using pull_request_target to access secrets when PRs come from forks |
| 31 | + pull_request_target: |
31 | 32 | types: [labeled, synchronize] |
32 | 33 |
|
33 | 34 | jobs: |
|
38 | 39 | ( |
39 | 40 | github.event_name == 'workflow_dispatch' || |
40 | 41 | github.event_name == 'push' || |
41 | | - (github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'trigger: preview')) |
| 42 | + (github.event_name == 'pull_request_target' && contains(github.event.pull_request.labels.*.name, 'trigger: preview')) |
42 | 43 | ) |
43 | 44 | runs-on: ubuntu-latest |
44 | 45 | outputs: |
|
47 | 48 | steps: |
48 | 49 | - name: Checkout code |
49 | 50 | uses: actions/checkout@v4 |
| 51 | + with: |
| 52 | + # For pull_request_target, we need to explicitly checkout the PR's head |
| 53 | + ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.sha }} |
50 | 54 |
|
51 | 55 | - name: Setup Node.js |
52 | 56 | uses: actions/setup-node@v4 |
|
94 | 98 | id: generate-token |
95 | 99 | uses: actions/create-github-app-token@v1 |
96 | 100 | with: |
97 | | - app-id: ${{ secrets.CROSS_REPO_APP_ID }} |
| 101 | + app-id: ${{ vars.CROSS_REPO_APP_ID }} |
98 | 102 | private-key: ${{ secrets.CROSS_REPO_APP_PRIVATE_KEY }} |
99 | 103 | owner: supabase |
100 | 104 | repositories: postgrest-js,supabase-js |
@@ -153,11 +157,11 @@ jobs: |
153 | 157 | body: | |
154 | 158 | <!-- postgrest-js-preview-status --> |
155 | 159 | 🚀 **Preview release created!** |
156 | | -
|
| 160 | + |
157 | 161 | supabase-js CI tests have been automatically triggered on feature branch to verify compatibility. |
158 | | -
|
| 162 | + |
159 | 163 | **Preview package:** `${{ needs.preview.outputs.preview-url }}` |
160 | | -
|
| 164 | + |
161 | 165 | Results will be posted here once testing is complete. |
162 | | -
|
| 166 | + |
163 | 167 | edit-mode: replace |
0 commit comments