This repository was archived by the owner on Nov 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
trigger workflows to run for pull_request event
#86
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
82371f6
trigger workflows to run for pull_request_target event
4daa46b
change to only pull_request
1f7cd63
check safe to test label
d2057f5
what happens when a PR with the safe-to-test label is pushed to
e007cdb
split pr_checks into safe + unsafe
785162c
update names of jobs
478ea61
try removing push trigger
912f1d4
add push trigger back so we can see the check as skipped, change labe…
910fc09
add pull_request back to safe checks
3a97b35
remove push because pull_request synchronize should cover it
884239c
remove arbitrary change
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: CI Checks - Unsafe | ||
| on: | ||
| push: | ||
| pull_request: | ||
| types: [labeled] | ||
|
|
||
| jobs: | ||
| Integration-Tests-External: | ||
| runs-on: ubuntu-latest | ||
| if: contains(github.event.pull_request.labels.*.name, 'run unsafe ci checks') | ||
| steps: | ||
| - run: echo "Running CI for branch ${{ github.ref }}." | ||
| - name: Check out repository code | ||
| uses: actions/checkout@v2 | ||
| - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." | ||
| - name: Run unit tests that connect to an external db | ||
| env: | ||
| REDSHIFT_TEST_URI: ${{ secrets.REDSHIFT_TEST_URI }} | ||
| SNOWFLAKE_TEST_URI: ${{ secrets.SNOWFLAKE_TEST_URI }} | ||
| run: make pytest-external-integration | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This condition was a bit confusing to me on first pass, so to break down for anyone else:
github.event.pull_request.labels.*.namethis statement is applying a filter on thegithub.event.pull_request.labelsvar, pull out a list of labelnames, e.g.["safe to run", "dont merge", ...].contains(list, "value")is then check if"value"is an element oflist.It seems simple when you put it that way, but if you don't know about the filter stage, it could look as though
github.event.pull_request.labels.*.nameevaluates to a string and we're checking if that string contains the PR name (which would be less robust).https://docs.github.com/en/actions/learn-github-actions/expressions#object-filters