From cdefb8cf1ba9ec3e4fe4f54f7adb24f48815323b Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Fri, 2 Jul 2021 17:07:05 +1000 Subject: [PATCH] Experimental: add autoblack.yml action [ci skip] --- .github/workflows/autoblack.yml | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .github/workflows/autoblack.yml diff --git a/.github/workflows/autoblack.yml b/.github/workflows/autoblack.yml new file mode 100644 index 000000000..ecfdb8af1 --- /dev/null +++ b/.github/workflows/autoblack.yml @@ -0,0 +1,37 @@ +# GitHub Action that uses Black to reformat all Python code and submits a PR +# in regular intervals. Inspired by: https://github.com/cclauss/autoblack + +name: autoblack +on: + schedule: + cron: '0 8 * * 5' + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.head_ref }} + - uses: actions/setup-python@v2 + - run: pip install black + - run: black --check spacy + - name: Auto-format code if needed + if: failure() + run: | + black spacy + git status + - name: Create Pull Request + uses: peter-evans/create-pull-request@v3 + with: + title: Auto-format code with black + labels: meta + commit-message: Auto-format code with black + committer: GitHub + author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> + body: _This PR is auto-generated._ + draft: false + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"