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

View File

@ -3,13 +3,22 @@ on:
push: push:
branches: branches:
- dev - dev
pull_request: pull_request_target:
types: [opened, synchronize] types: [opened, synchronize]
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
jobs: 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: build-unix:
needs: authorize
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
matrix: matrix:
@ -18,6 +27,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive submodules: recursive
- name: ccache - name: ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2
@ -87,6 +97,7 @@ jobs:
name: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }} name: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}
path: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}.tar.gz path: Zelda64Recompiled-${{ runner.os }}-${{ matrix.type }}.tar.gz
build-windows: build-windows:
needs: authorize
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:
matrix: matrix:
@ -95,6 +106,7 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v4
with: with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}
submodules: recursive submodules: recursive
- name: ccache - name: ccache
uses: hendrikmuhs/ccache-action@v1.2 uses: hendrikmuhs/ccache-action@v1.2