CI: Enable secrets on forks with approval (#227)

This commit is contained in:
David Chavez 2024-05-20 22:55:59 +02:00 committed by GitHub
parent f872ca87cc
commit 0b609752ce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 1 deletions

View File

@ -3,13 +3,22 @@ on:
push:
branches:
- dev
pull_request:
pull_request_target:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
authorize:
environment:
${{ github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository &&
'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: echo ✓
build-unix:
needs: authorize
runs-on: ubuntu-22.04
strategy:
matrix:
@ -18,6 +27,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2
@ -87,6 +97,7 @@ jobs:
name: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}
path: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}.tar.gz
build-windows:
needs: authorize
runs-on: windows-latest
strategy:
matrix:
@ -95,6 +106,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2