From 4c5a3a2a7ba19ce71023e9d34ad66d005ab74000 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 17 Mar 2023 09:35:00 +0100 Subject: [PATCH 1/2] Remove autoblack workflow (#12437) Now that all PRs have `black` formatting validation, we no longer need the autoblack workflow. --- .github/workflows/autoblack.yml | 45 --------------------------------- 1 file changed, 45 deletions(-) delete mode 100644 .github/workflows/autoblack.yml diff --git a/.github/workflows/autoblack.yml b/.github/workflows/autoblack.yml deleted file mode 100644 index 555322782..000000000 --- a/.github/workflows/autoblack.yml +++ /dev/null @@ -1,45 +0,0 @@ -# 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: - workflow_dispatch: # allow manual trigger - schedule: - - cron: '0 8 * * 5' # every Friday at 8am UTC - -jobs: - autoblack: - if: github.repository_owner == 'explosion' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.head_ref }} - - uses: actions/setup-python@v4 - - run: pip install black -c requirements.txt - - name: Auto-format code if needed - run: black spacy - # We can't run black --check here because that returns a non-zero excit - # code and makes GitHub think the action failed - - name: Check for modified files - id: git-check - run: echo modified=$(if git diff-index --quiet HEAD --; then echo "false"; else echo "true"; fi) >> $GITHUB_OUTPUT - - - name: Create Pull Request - if: steps.git-check.outputs.modified == 'true' - uses: peter-evans/create-pull-request@v4 - with: - title: Auto-format code with black - labels: meta - commit-message: Auto-format code with black - committer: GitHub - author: explosion-bot - body: _This PR is auto-generated._ - branch: autoblack - delete-branch: true - draft: false - - name: Check outputs - if: steps.git-check.outputs.modified == 'true' - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" From 5f72d6c83605d391550c3a992d7e772440501b07 Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 17 Mar 2023 10:01:49 +0100 Subject: [PATCH 2/2] CI: Switch PR back to paths-ignore (#12438) Switch PR tests back to paths-ignore but include changes to `.github` for all PRs rather than trying to figure out complicated includes+excludes. Changes to `.github` are relatively rare and should not be a huge burden for the CI. --- .github/workflows/tests.yml | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c18f9cd23..eef24ff33 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,21 +21,18 @@ on: - ".github/workflows/**" pull_request: types: [opened, synchronize, reopened, edited] - paths: - - "**" - - "!*.md" - - "!*.mdx" - - "!website/docs/**" - - "!website/src/**" - - "!website/meta/*.tsx" - - "!website/meta/*.mjs" - - "!website/meta/languages.json" - - "!website/meta/site.json" - - "!website/meta/sidebars.json" - - "!website/meta/type-annotations.json" - - "!website/pages/**" - - "!.github/workflows/**" - - ".github/workflows/tests.yml" + paths-ignore: + - "*.md" + - "*.mdx" + - "website/docs/**" + - "website/src/**" + - "website/meta/*.tsx" + - "website/meta/*.mjs" + - "website/meta/languages.json" + - "website/meta/site.json" + - "website/meta/sidebars.json" + - "website/meta/type-annotations.json" + - "website/pages/**" jobs: validate: