From 7fd70c36114bac27e0d46d1be97bb614f90b70a4 Mon Sep 17 00:00:00 2001 From: dcvz Date: Sat, 1 Jun 2024 22:55:55 +0200 Subject: [PATCH] Try to split workflow paths --- .github/workflows/validate.yml | 22 ++++------------------ .github/workflows/validate_external.yml | 22 ++++++++++++++++++++++ .github/workflows/validate_internal.yml | 15 +++++++++++++++ 3 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/validate_external.yml create mode 100644 .github/workflows/validate_internal.yml diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index fbaf051..dcf5d4f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -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: diff --git a/.github/workflows/validate_external.yml b/.github/workflows/validate_external.yml new file mode 100644 index 0000000..51628f3 --- /dev/null +++ b/.github/workflows/validate_external.yml @@ -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 }} diff --git a/.github/workflows/validate_internal.yml b/.github/workflows/validate_internal.yml new file mode 100644 index 0000000..3ed7973 --- /dev/null +++ b/.github/workflows/validate_internal.yml @@ -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