File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,25 @@ jobs:
2121 uses : actions/checkout@v3
2222 if : github.event_name == 'workflow_dispatch'
2323
24- - name : Check files using the ruff formatter
24+ # This is used for forked PRs as write permissions are required to format files
25+ - name : Run and commit changes with `ruff format .` locally on your forked branch to fix errors if they appear
26+ if : ${{ github.event.pull_request.head.repo.fork == true }}
27+ uses : chartboost/ruff-action@v1
28+ id : ruff_formatter_suggestions
29+ with :
30+ args : format --diff
31+
32+ # This only runs if the PR is NOT from a forked repo
33+ - name : Format files using ruff
34+ if : ${{ github.event.pull_request.head.repo.fork == false }}
2535 uses : chartboost/ruff-action@v1
2636 id : ruff_formatter
2737 with :
2838 args : format
2939
40+ # This only runs if the PR is NOT from a forked repo
3041 - name : Auto commit ruff formatting
42+ if : ${{ github.event.pull_request.head.repo.fork == false }}
3143 uses : stefanzweifel/git-auto-commit-action@v5
3244 with :
33- commit_message : ' style fixes by ruff'
45+ commit_message : ' style fixes by ruff'
Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ def test_integration_basic_dbt(self):
4646 # 1 with a diff
4747 assert diff_string .count (" Rows Added Rows Removed" ) == 1
4848
49+ @unittest .skipIf (
50+ not os .environ .get ("MOTHERDUCK_TOKEN" ),
51+ "MOTHERDUCK_TOKEN doesn't exist or is empty if this is run from a forked branch pull request" ,
52+ )
4953 def test_integration_motherduck_dbt (self ):
5054 artifacts_path = os .getcwd () + "/tests/dbt_artifacts"
5155 test_project_path = os .environ .get ("DATA_DIFF_DBT_PROJ" ) or artifacts_path
You can’t perform that action at this time.
0 commit comments