-
Notifications
You must be signed in to change notification settings - Fork 2
33 lines (29 loc) · 995 Bytes
/
external_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
name: Validate external Pull Request
on:
pull_request:
types: [opened, synchronize, reopened]
env:
LOCAL_PR: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
jobs:
variables: # env variables are not accessible through job.if (https://stackoverflow.com/q/73558652)
runs-on: ubuntu-latest
outputs:
LOCAL_PR: ${{ steps.init.outputs.LOCAL_PR }}
steps:
- name: Make environment variables global
id: init
run: |
echo "LOCAL_PR=${{ env.LOCAL_PR }}" >> $GITHUB_OUTPUT
isort:
needs: variables
# if PR is external, trigger the tests on push or new PR
if: ${{ needs.variables.outputs.LOCAL_PR == 'false'}}
uses: ./.github/workflows/isort.yml
black:
needs: variables
if: ${{ needs.variables.outputs.LOCAL_PR == 'false' }}
uses: ./.github/workflows/black.yml
build:
needs: variables
if: ${{ needs.variables.outputs.LOCAL_PR == 'false' }}
uses: ./.github/workflows/build.yml