Try to split workflow paths

This commit is contained in:
dcvz 2024-06-01 22:55:55 +02:00
parent 3e5efc935e
commit 7fd70c3611
3 changed files with 41 additions and 18 deletions

View file

@ -1,24 +1,11 @@
name: validate
on:
push:
branches:
- dev
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
workflow_call:
secrets:
ZRE_REPO_WITH_PAT:
required: 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-linux:
needs: authorize
runs-on: ${{ matrix.arch == 'x64' && matrix.os || format('blaze/{0}', matrix.os) }}
strategy:
matrix:
@ -107,7 +94,6 @@ jobs:
name: Zelda64Recompiled-AppImage-${{ runner.arch }}-${{ matrix.type }}
path: Zelda64Recompiled-*.AppImage
build-windows:
needs: authorize
runs-on: windows-latest
strategy:
matrix:

22
.github/workflows/validate_external.yml vendored Normal file
View file

@ -0,0 +1,22 @@
name: validate
on:
pull_request_target:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
authorize:
if: github.repository != github.event.pull_request.head.repo.full_name
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:
needs: authorize
uses: ./.github/workflows/validate.yml
secrets:
ZRE_REPO_WITH_PAT: ${{ secrets.ZRE_REPO_WITH_PAT }}

15
.github/workflows/validate_internal.yml vendored Normal file
View file

@ -0,0 +1,15 @@
name: validate
on:
push:
branches:
- dev
pull_request:
types: [opened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
if: github.repository == github.event.pull_request.head.repo.full_name
uses: ./.github/workflows/validate.yml
secrets: inherit