File tree Expand file tree Collapse file tree 3 files changed +16
-15
lines changed
Expand file tree Collapse file tree 3 files changed +16
-15
lines changed Original file line number Diff line number Diff line change 1313 * [ Add code] ( #add-code )
1414 * [ Finish with the documentation] ( #finish-with-the-documentation )
1515* [ Contributing to Python code] ( #contributing-to-python-code )
16+ * [ Run tests in your fork] ( #run-tests-in-your-fork )
1617
1718## Run and debug hooks locally
1819
1920``` bash
2021pre-commit try-repo {-a} /path/to/local/pre-commit-terraform/repo {hook_name}
21- ```
22-
23- I.e.
24-
25- ``` bash
26- pre-commit try-repo /mnt/c/Users/tf/pre-commit-terraform terraform_fmt # Run only `terraform_fmt` check
27- pre-commit try-repo -a ~ /pre-commit-terraform # run all existing checks from repo
28- ```
29-
30- Running ` pre-commit ` with ` try-repo ` ignores all arguments specified in ` .pre-commit-config.yaml ` .
31-
32- If you need to test hook with arguments, follow [ pre-commit doc] ( https://pre-commit.com/#arguments-pattern-in-hooks ) to test hooks.
33-
34- For example, to test that the [ ` terraform_fmt ` ] ( ../README.md#terraform_fmt ) hook works fine with arguments:
35-
22+ ` ` ` g run on this fork
3623` ` ` bash
3724/tmp/pre-commit-terraform/terraform_fmt.sh --args=-diff --args=-write=false test-dir/main.tf test-dir/vars.tf
3825```
@@ -182,3 +169,11 @@ You can use [this PR](https://github.com/antonbabenko/pre-commit-terraform/pull/
182169 ` ` ` bash
183170 tox list
184171 ` ` `
172+
173+ # # Run tests in your fork
174+
175+ Go to you fork `Actions` tab and click on big green button
176+
177+ 
178+
179+ Now you can see are the tests pass before submitting PR.
Original file line number Diff line number Diff line change 8484 name : ⚙️ Pre-set global build settings
8585
8686 runs-on : ubuntu-latest
87+ # Prevent run 'push' events for the branches in upstream repository as it
88+ # already covered by 'pull_request' event
89+ if : (github.event_name == 'push' && github.repository == 'pre-commit/pre-commit-terraform' &&
90+ github.branch == 'master') ||
91+ (github.event_name == 'push' && github.repository != 'pre-commit/pre-commit-terraform') ||
92+ github.event_name != 'push'
8793
8894 timeout-minutes : 1
8995
You can’t perform that action at this time.
0 commit comments