use pr target

This commit is contained in:
Nate 2025-01-29 23:00:04 -08:00
parent 682ef31ee3
commit 8b3b3e00da

View file

@ -1,7 +1,7 @@
name: PR checks
on:
pull_request:
pull_request_target:
branches:
- main
paths:
@ -9,7 +9,6 @@ on:
- "extensions/vscode/**"
- "core/**"
- "gui/**"
- ".github/workflows/**"
push:
branches:
@ -22,10 +21,21 @@ on:
- ".github/workflows/**"
jobs:
validate-pr:
runs-on: ubuntu-latest
environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }}
steps:
- uses: actions/checkout@v4
install-root:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -45,6 +55,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -74,6 +89,11 @@ jobs:
environment: ${{ github.event.pull_request.head.repo.fork == true && 'tests-requiring-secrets' || '' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -103,6 +123,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -134,6 +159,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -164,6 +194,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -200,6 +235,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -233,6 +273,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -264,6 +309,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -290,6 +340,10 @@ jobs:
test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Cache node modules
uses: actions/cache@v3
@ -317,6 +371,11 @@ jobs:
needs: [install-vscode, install-core]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -349,6 +408,11 @@ jobs:
needs: [install-vscode, install-core]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -397,6 +461,11 @@ jobs:
command: ["e2e:ci:run", "e2e:ci:run-yaml"]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -459,6 +528,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
@ -490,6 +564,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
# This is important - it switches from the base repo to the fork
repository: ${{ github.event.pull_request.head.repo.full_name }}
- uses: actions/cache@v4
with: