From 355ef8188a34d63eb0d93bd8b3329f6a15e68e59 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 26 Jul 2023 02:09:16 +0200 Subject: Add workflow to verify `CHANGELOG` is always up-to-date --- .github/workflows/verify.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .github/workflows/verify.yml (limited to '.github') diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml new file mode 100644 index 00000000..f7342ac1 --- /dev/null +++ b/.github/workflows/verify.yml @@ -0,0 +1,17 @@ +name: Verify +on: + pull_request: + branches: + - master +jobs: + changelog: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + - name: Check `CHANGELOG.md` has changes + run: | + ! git diff --exit-code master HEAD CHANGELOG.md + - name: Check `CHANGELOG.md` has PR author + if: ${{ github.event.pull_request.user.name != 'hecrj' }} + run: | + sed -n '/## \[Unreleased\]/,/^## /p' CHANGELOG.md | sed -n '/Many thanks to.../,//p' | grep '@${{ github.event.pull_request.user.name }}' -- cgit From 269e5410da8a9d04b62671042167ea475283d678 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 26 Jul 2023 02:19:25 +0200 Subject: Fetch all repository history in `verify` workflow --- .github/workflows/verify.yml | 2 ++ 1 file changed, 2 insertions(+) (limited to '.github') diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index f7342ac1..6f48415a 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -8,6 +8,8 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v2 + with: + fetch-depth: 0 - name: Check `CHANGELOG.md` has changes run: | ! git diff --exit-code master HEAD CHANGELOG.md -- cgit From d9faf4c9808f9959ac3dcba052c4c2febd1d0481 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 26 Jul 2023 02:19:44 +0200 Subject: Use `login` instead of `name` in `verify` workflow --- .github/workflows/verify.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github') diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 6f48415a..84778e91 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -14,6 +14,6 @@ jobs: run: | ! git diff --exit-code master HEAD CHANGELOG.md - name: Check `CHANGELOG.md` has PR author - if: ${{ github.event.pull_request.user.name != 'hecrj' }} + if: ${{ github.event.pull_request.user.login != 'hecrj' }} run: | - sed -n '/## \[Unreleased\]/,/^## /p' CHANGELOG.md | sed -n '/Many thanks to.../,//p' | grep '@${{ github.event.pull_request.user.name }}' + sed -n '/## \[Unreleased\]/,/^## /p' CHANGELOG.md | sed -n '/Many thanks to.../,//p' | grep '@${{ github.event.pull_request.user.login }}' -- cgit From 0be3fe4ec760dd4eba1b753b87b6f89c61d29747 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 26 Jul 2023 02:24:22 +0200 Subject: Use `origin/master` instead of `master` in `verify` workflow --- .github/workflows/verify.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index 84778e91..3de8a21c 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -12,7 +12,7 @@ jobs: fetch-depth: 0 - name: Check `CHANGELOG.md` has changes run: | - ! git diff --exit-code master HEAD CHANGELOG.md + ! git diff --exit-code origin/master HEAD -- CHANGELOG.md - name: Check `CHANGELOG.md` has PR author if: ${{ github.event.pull_request.user.login != 'hecrj' }} run: | -- cgit