/ .github / workflows / build-fork.yml
build-fork.yml
 1  name: Build PR From Fork
 2  
 3  concurrency:
 4    group: ${{ github.workflow }}-${{ github.head_ref }}
 5    cancel-in-progress: true
 6  
 7  on:
 8    pull_request:
 9      branches: ['main']
10  
11  jobs:
12    build:
13      runs-on: ubuntu-latest
14      if: | # check if PR opened from fork
15        github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name || contains(github.head_ref, 'dependabot')
16      steps:
17        - uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b # v3.0.2
18          with:
19            persist-credentials: false
20  
21        - name: Build App
22          uses: ./.github/actions/build
23          with:
24            NEXT_PUBLIC_ENV: 'prod'
25  
26        - name: Upload artifacts
27          uses: ./.github/actions/upload-artifacts