From 3ebfe9daa9c942446cc0cb8b6d8772c23a87bb15 Mon Sep 17 00:00:00 2001 From: Nicola Demo Date: Fri, 9 Feb 2024 12:12:15 +0100 Subject: [PATCH] Create black-formatter.yml (#232) --- .github/workflows/black-formatter.yml | 32 +++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/black-formatter.yml diff --git a/.github/workflows/black-formatter.yml b/.github/workflows/black-formatter.yml new file mode 100644 index 0000000..70279d2 --- /dev/null +++ b/.github/workflows/black-formatter.yml @@ -0,0 +1,32 @@ +name: Black Formatter + +on: + push: + branches: + - master + +jobs: + linter: + name: runner / black + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - uses: psf/black@stable + id: action_black + with: + options: "-l 80" + src: "./pina" + + - name: Create Pull Request + if: steps.action_black.outputs.is_formatted == 'true' + uses: peter-evans/create-pull-request@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + title: "Format Python code with psf/black push" + commit-message: ":art: Format Python code with psf/black" + body: | + There appear to be some python formatting errors in ${{ github.sha }}. This pull request + uses the [psf/black](https://github.com/psf/black) formatter to fix these issues. + base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch + branch: actions/black