diff --git a/.github/workflows/black-code-formatter.yml b/.github/workflows/black-code-formatter.yml index 96dc0673b..2b63149f6 100644 --- a/.github/workflows/black-code-formatter.yml +++ b/.github/workflows/black-code-formatter.yml @@ -1,6 +1,6 @@ name: Python Black Linter -on: [push, pull_request] +on: [ push, pull_request ] jobs: lint: @@ -11,3 +11,19 @@ jobs: with: options: "--check" src: "./ersilia" + comment-lint: + if: github.event.issue.pull_request && contains(github.event.comment.body, '✨') + runs-on: ubuntu-latest + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: + - name: Checkout branch + uses: actions/checkout@v3 + - name: Lint files + uses: psf/black@stable + with: + src: "./ersilia" + - name: Commit lint + uses: stefanzweifel/git-auto-commit-action@v5