Skip to content

Commit 5b8bfdd

Browse files
DevOpsDevOps
authored andcommitted
feat: sync the updated precommitfiles
1 parent 8b3183b commit 5b8bfdd

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

.github/workflows/sync-precommit-config.yaml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Sync Pre-commit Config
22

33
on:
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
@@ -35,9 +38,9 @@ jobs:
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

0 commit comments

Comments
 (0)