Skip to content

Renders the whole code using Black code style #6

Renders the whole code using Black code style

Renders the whole code using Black code style #6

name: Renders the whole code using Black code style
on:
workflow_dispatch:
jobs:
black:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
persist-credentials: false
fetch-depth: 0
- name: Black-ify
uses: psf/black@stable
with:
options: "--verbose"
- name: Commit changes
run: |
d=`date '+%Y/%m/%dT%H:%M:%SZ'`
git config --local user.email ${{ secrets.MAIL }}
git config --local user.name ${{ secrets.USERNAME }}
git add -A
git commit -m "Code style changed to Black at ${d}" || echo "No changes to commit"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "Apply Black code style"
title: "Apply Black code style"
body: |
This pull request is auto-generated by the Black Code Formatter GitHub action.
Please review the changes before merging.
labels: style
branch: format-code-${{ github.run_number }}
assignees: EDM115
reviewers: EDM115
draft: true
token: ${{ secrets.GITHUB_TOKEN }}