diff --git a/.github/workflows/news-file.yaml b/.github/workflows/news-file.yaml deleted file mode 100644 index 0e219871a..000000000 --- a/.github/workflows/news-file.yaml +++ /dev/null @@ -1,13 +0,0 @@ -on: - pull_request: - types: [labeled, unlabeled, opened, reopened, synchronize] -jobs: - check-news-file: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v2 - with: - # `towncrier check` needs enough history to run `git diff --name-only origin/main...` - fetch-depth: 0 - - run: pipx run towncrier check --compare-with origin/main - if: ${{ ! (contains(github.event.pull_request.labels.*.name, 'trivial')) }} diff --git a/.github/workflows/news-file.yml b/.github/workflows/news-file.yml new file mode 100644 index 000000000..2c7680d0b --- /dev/null +++ b/.github/workflows/news-file.yml @@ -0,0 +1,25 @@ +name: Check + +on: + pull_request: + types: [labeled, unlabeled, opened, reopened, synchronize] + +jobs: + check-news-entry: + name: news entry + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + with: + # `towncrier check` runs `git diff --name-only origin/main...`, which + # needs a non-shallow clone. + fetch-depth: 0 + + - name: Check news entry + if: "!contains(github.event.pull_request.labels.*.name, 'trivial')" + run: | + if ! pipx run towncrier check --compare-with origin/${{ github.base_ref }}; then + echo "Please see https://pip.pypa.io/dev/news-entry-failure for guidance." + false + fi