From 0beca9d96ced7211c50549c620db253d56525044 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Thu, 5 Jan 2023 16:01:07 +0000 Subject: [PATCH 1/2] CI: fail if a changenote filename doesn't have the right format --- .github/workflows/check-change-note.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/check-change-note.yml b/.github/workflows/check-change-note.yml index b60a590ab09..6cc2cb03b9b 100644 --- a/.github/workflows/check-change-note.yml +++ b/.github/workflows/check-change-note.yml @@ -26,3 +26,9 @@ jobs: run: | gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' | grep true -c + - name: Fail if the change note filename doesn't match the expected format. + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq '[.[].filename | select(test("/change-notes/.*[.]md$"))] | all(test("/change-notes/[0-9]{4}-[0-9]{2}-[0-9]{2}.*[.]md$"))' | + grep true -c From 4e6baf83c8b906b1ea0119edbc8c85444c3bcb13 Mon Sep 17 00:00:00 2001 From: Nick Rolfe Date: Thu, 5 Jan 2023 16:26:43 +0000 Subject: [PATCH 2/2] Update .github/workflows/check-change-note.yml Co-authored-by: Taus --- .github/workflows/check-change-note.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-change-note.yml b/.github/workflows/check-change-note.yml index 6cc2cb03b9b..e951b17b89b 100644 --- a/.github/workflows/check-change-note.yml +++ b/.github/workflows/check-change-note.yml @@ -26,7 +26,7 @@ jobs: run: | gh api 'repos/${{github.repository}}/pulls/${{github.event.number}}/files' --paginate --jq 'any(.[].filename ; test("/change-notes/.*[.]md$"))' | grep true -c - - name: Fail if the change note filename doesn't match the expected format. + - name: Fail if the change note filename doesn't match the expected format. The file name must be of the form 'YYYY-MM-DD.md' or 'YYYY-MM-DD-{title}.md', where '{title}' is arbitrary text. env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: |