File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 5353 TESTS_DIR : ${{ github.workspace }}/dbt-data-reliability/integration_tests
5454
5555jobs :
56+ detect-fork :
57+ runs-on : ubuntu-latest
58+ outputs :
59+ requires_approval : ${{ steps.set-output.outputs.requires_approval }}
60+ steps :
61+ - name : Set fork output
62+ id : set-output
63+ run : |
64+ if [[ "${{ github.event_name }}" == "pull_request_target" && "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]]; then
65+ echo "requires_approval=true" >> $GITHUB_OUTPUT
66+ else
67+ echo "requires_approval=false" >> $GITHUB_OUTPUT
68+ fi
69+
5670 test :
5771 runs-on : ubuntu-latest
58- environment : elementary_test_env # This is a github environment (not to be confused with env vars)
72+ needs : [detect-fork]
73+ # PRs from forks require approval - so we use an environment that requires an approver from the team.
74+ environment : ${{ (steps.detect-fork.outputs.requires_approval == 'true' && 'elementary_test_env') || '' }}
5975 concurrency :
6076 # This is what eventually defines the schema name in the data platform.
6177 group : tests_${{ inputs.warehouse-type }}_dbt_${{ inputs.dbt-version }}_${{ github.head_ref || github.ref_name }}
You can’t perform that action at this time.
0 commit comments