Skip to content

Commit f88a31c

Browse files
authored
Allow contributor PRs to run tests - dbt package (#799)
* Add logic to use environments * Use pull_request_target * rename environment * fix condition
1 parent 53a488b commit f88a31c

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/test-all-warehouses.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Test all warehouse platforms
22
on:
3-
pull_request:
3+
pull_request_target:
44
branches: ["master"]
55
# Allows you to run this workflow manually from the Actions tab
66
workflow_dispatch:
@@ -66,7 +66,7 @@ jobs:
6666
warehouse-type: ${{ matrix.warehouse-type }}
6767
dbt-version: ${{ matrix.dbt-version }}
6868
elementary-ref: ${{ inputs.elementary-ref }}
69-
dbt-data-reliability-ref: ${{ inputs.dbt-data-reliability-ref }}
69+
dbt-data-reliability-ref: ${{ inputs.dbt-data-reliability-ref || (github.event_name == 'pull_request_target' && github.event.pull_request.head.sha) || '' }}
7070
secrets: inherit
7171

7272
notify_failures:

.github/workflows/test-warehouse.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ env:
5353
jobs:
5454
test:
5555
runs-on: ubuntu-latest
56+
environment: elementary_test_env # This is a github environment (not to be confused with env vars)
5657
concurrency:
5758
# This is what eventually defines the schema name in the data platform.
5859
group: tests_${{ inputs.warehouse-type }}_dbt_${{ inputs.dbt-version }}_${{ github.head_ref || github.ref_name }}

0 commit comments

Comments
 (0)