|
24 | 24 | uses: actions/github-script@v8 |
25 | 25 | with: |
26 | 26 | script: | |
27 | | - const runId = context.payload.workflow_run.id; |
| 27 | + const workflowRun = context.payload.workflow_run; |
| 28 | + const headBranch = workflowRun?.head_branch; |
| 29 | + if (typeof headBranch === 'string' && headBranch.startsWith('hotfix/')) { |
| 30 | + core.info('hotfix/* branch detected; skipping CI job verification.'); |
| 31 | + return; |
| 32 | + } |
| 33 | +
|
| 34 | + const runId = workflowRun.id; |
28 | 35 | const requiredJobs = ['Lint', 'Unit Tests']; |
29 | 36 | const { data } = await github.rest.actions.listJobsForWorkflowRun({ |
30 | 37 | owner: context.repo.owner, |
@@ -70,11 +77,14 @@ jobs: |
70 | 77 | id: vercel-preview |
71 | 78 | with: |
72 | 79 | vercel-token: ${{ secrets.VERCEL_TOKEN }} |
| 80 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
73 | 81 | vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} |
74 | 82 | vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} |
75 | 83 | github-comment: false |
76 | 84 | env: |
77 | 85 | VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} |
| 86 | + GITHUB_SHA: ${{ github.event.workflow_run.head_sha }} |
| 87 | + GITHUB_REF: refs/heads/${{ github.event.workflow_run.head_branch }} |
78 | 88 |
|
79 | 89 | - name: Comment preview URL on PR |
80 | 90 | if: ${{ !startsWith(github.event.workflow_run.head_branch, 'hotfix/') && always() && steps.vercel-preview.outcome == 'success' }} |
@@ -285,11 +295,14 @@ jobs: |
285 | 295 | id: vercel-production |
286 | 296 | with: |
287 | 297 | vercel-token: ${{ secrets.VERCEL_TOKEN }} |
| 298 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
288 | 299 | vercel-args: '--prod' |
289 | 300 | vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }} |
290 | 301 | vercel-org-id: ${{ secrets.VERCEL_ORG_ID }} |
291 | 302 | env: |
292 | 303 | VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }} |
| 304 | + GITHUB_SHA: ${{ github.event.workflow_run.head_sha }} |
| 305 | + GITHUB_REF: refs/heads/${{ github.event.workflow_run.head_branch }} |
293 | 306 |
|
294 | 307 | - name: Log production deployment |
295 | 308 | if: always() && steps.vercel-production.outcome == 'success' |
|
0 commit comments