File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ name: Sync Pre-commit Config
22
33on :
44 push :
5+ branches :
6+ - feat/precommit-config
57 paths :
68 - " .pre-commit-config.yaml"
79 - " precommitFile/**"
@@ -18,10 +20,11 @@ jobs:
1820 - name : Checkout repository
1921 uses : actions/checkout@v4
2022
23+ - name : Ensure precommitFile directory exists
24+ run : mkdir -p precommitFile
25+
2126 - name : Copy .pre-commit-config.yaml to precommitFile directory
22- run : |
23- mkdir -p precommitFile
24- cp .pre-commit-config.yaml precommitFile/.pre-commit-config.yaml
27+ run : cp .pre-commit-config.yaml precommitFile/.pre-commit-config.yaml
2528
2629 - name : Check for changes
2730 id : git_status
3538 - name : Commit and push changes
3639 if : steps.git_status.outputs.changed == 'true'
3740 run : |
38- git config --local user.email "actions@github.com"
39- git config --local user.name "GitHub Actions"
40- git add precommitFile/.pre-commit-config.yaml
41+ git config user.name "GitHub Actions"
42+ git config user.email "actions@github.com"
4143
42- git commit -m "Sync pre-commit-config.yaml to precommitFile/"
44+ git add precommitFile/.pre-commit-config.yaml
45+ git commit -m "Sync .pre-commit-config.yaml to precommitFile directory"
4346 git push
You can’t perform that action at this time.
0 commit comments