Skip to content

Commit

Permalink
Fix permission issue for pull request triggered GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
mnixry committed Feb 27, 2024
1 parent 4209f39 commit 5068885
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: CI

on:
push:
pull_request_target:
types: [opened, synchronize]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -62,6 +64,9 @@ jobs:
runs-on: ubuntu-latest
needs: build

# If push event triggered, it must not be a pull request
if: github.event_name != 'push' || !startsWith(github.ref, 'refs/pull/')

env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
Expand All @@ -70,6 +75,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}

- uses: actions/download-artifact@v4
with:
Expand Down

0 comments on commit 5068885

Please sign in to comment.