Skip to content

Commit b60c029

Browse files
authored
Update black.yml
updated action script
1 parent 8d61727 commit b60c029

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/black.yml

+8-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ["3.8", "3.9", "3.10"]
17+
python-version: ["3.10"]
1818
steps:
1919
- uses: actions/checkout@v3
2020
- name: Set up Python ${{ matrix.python-version }}
@@ -30,10 +30,14 @@ jobs:
3030
black $(git ls-files '*.py')
3131
- name: Commit changes
3232
run: |
33-
git config --local user.email "action@github.com"
34-
git config --local user.name "GitHub Action"
33+
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
34+
git config --local user.name "${{ github.actor }}"
35+
git stash -u
36+
black $(git ls-files '*.py')
37+
git stash pop
3538
git add .
36-
git diff-index --quiet HEAD || git commit -m "Format Python code with Black"
39+
message="$(git log -1 --pretty=%B) Format Python code with Black"
40+
git diff-index --quiet HEAD || git commit -m "$message"
3741
- name: Push changes
3842
run: |
3943
git push origin master

0 commit comments

Comments
 (0)