Skip to content

Commit 073bf02

Browse files
committed
Git commit automatically in action
1 parent faca7a1 commit 073bf02

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

.github/workflows/test_run_funcs.yml

-10
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,3 @@ jobs:
5757
done
5858
5959
exit $status
60-
- name: Git commit
61-
run: |
62-
# git commit if there's any change
63-
if test -n "$(git status --porcelain 2>/dev/null)"; then
64-
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
65-
git config --local user.name "github-actions[bot]"
66-
git add .
67-
git commit -m "Add changes"
68-
git push origin ${GITHUB_REF##*/}
69-
fi

action.yml

+11
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ runs:
1717
python3 -m pip install gitfx
1818
python3 -m gitfx ${{ inputs.filepath }}
1919
shell: bash
20+
- name: Git commit
21+
run: |
22+
# git commit if there's any change
23+
if test -n "$(git status --porcelain 2>/dev/null)"; then
24+
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
25+
git config --local user.name "github-actions[bot]"
26+
git add .
27+
git commit -m "Add changes"
28+
git push origin ${GITHUB_REF##*/}
29+
fi
30+
shell: bash
2031
branding:
2132
icon: 'cloud-lightning'
2233
color: 'purple'

0 commit comments

Comments
 (0)