From acc61e44a83a170ce73742eccb5cd0b5af2709c2 Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Sat, 14 Oct 2023 16:09:26 +1000 Subject: [PATCH 01/10] Add workflow --- .github/workflows/check_changelog.yaml | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/check_changelog.yaml diff --git a/.github/workflows/check_changelog.yaml b/.github/workflows/check_changelog.yaml new file mode 100644 index 0000000000..1ceae9e42e --- /dev/null +++ b/.github/workflows/check_changelog.yaml @@ -0,0 +1,29 @@ +name: Verify changelog updated + +on: [push, pull_request] + +jobs: + check: + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Check for Change Log Modification + run: | + changed_files=$(git diff --name-only HEAD~1..HEAD) + + changelog_modified=$(echo "$changed_files" | grep '^CHANGELOG.rst$' || true) + + python_or_rst_modified=$(echo "$changed_files" | grep '.*\.\(rst\|py\)$' || true) + + if [ -z "$changelog_modified" ] && [ ! -z "$python_or_rst_modified" ] + then + echo "Error: Changelog not modified while .rst or .py files have been modified" + exit 1 + else + echo "Changelog modified or no .rst/.py files have been modified" + fi \ No newline at end of file From 8e815049fad42fc262ca795b8939b479d16366db Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Mon, 16 Oct 2023 12:35:18 +1000 Subject: [PATCH 02/10] Use different method for calculating changed paths --- .github/workflows/check_changelog.yaml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_changelog.yaml b/.github/workflows/check_changelog.yaml index 1ceae9e42e..19adc5ff8f 100644 --- a/.github/workflows/check_changelog.yaml +++ b/.github/workflows/check_changelog.yaml @@ -1,6 +1,15 @@ name: Verify changelog updated -on: [push, pull_request] +on: + push: + paths: + - '**.rst' + - '**.py' + pull_request: + paths: + - '**.rst' + - '**.py' + jobs: check: @@ -14,12 +23,7 @@ jobs: - name: Check for Change Log Modification run: | - changed_files=$(git diff --name-only HEAD~1..HEAD) - changelog_modified=$(echo "$changed_files" | grep '^CHANGELOG.rst$' || true) - - python_or_rst_modified=$(echo "$changed_files" | grep '.*\.\(rst\|py\)$' || true) - if [ -z "$changelog_modified" ] && [ ! -z "$python_or_rst_modified" ] then echo "Error: Changelog not modified while .rst or .py files have been modified" From dcc5f3a47d488e2211140de4afbbcb19c91c2980 Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:49:28 +1000 Subject: [PATCH 03/10] Update workflow --- .github/workflows/check_changelog.yaml | 42 ++++++++++++++------------ 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check_changelog.yaml b/.github/workflows/check_changelog.yaml index 19adc5ff8f..1ddd767933 100644 --- a/.github/workflows/check_changelog.yaml +++ b/.github/workflows/check_changelog.yaml @@ -1,33 +1,35 @@ name: Verify changelog updated on: - push: - paths: - - '**.rst' - - '**.py' pull_request: paths: - '**.rst' - '**.py' + types: + - opened + - ready_for_review jobs: - check: + check_changes: runs-on: ubuntu-latest - steps: - - name: Checkout Code - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - name: Checkout repo + uses: actions/checkout@v2 - - name: Check for Change Log Modification - run: | - changelog_modified=$(echo "$changed_files" | grep '^CHANGELOG.rst$' || true) - if [ -z "$changelog_modified" ] && [ ! -z "$python_or_rst_modified" ] - then - echo "Error: Changelog not modified while .rst or .py files have been modified" - exit 1 - else - echo "Changelog modified or no .rst/.py files have been modified" - fi \ No newline at end of file + - name: Get changed files + id: getfile + run: | + echo "Files changed:" + CHANGED_FILES=$(git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) + echo "$CHANGED_FILES" + echo "CHANGED_FILES<> $GITHUB_ENV + echo "$CHANGED_FILES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + + - name: Comment PR + uses: thollander/actions-comment-pull-request@master + with: + message: 'Thank you for the PR! The changelog has not been updated so here is a friendly reminder to check if you need at add an entry.' + GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' + if: contains(fromJson(env.CHANGED_FILES), '.py') && !contains(fromJson(env.CHANGED_FILES), 'changelog.rst') From 48695ba8fb150548f183087ec9faf4908e838a57 Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:50:08 +1000 Subject: [PATCH 04/10] Rename folder --- .../workflows/{check_changelog.yaml => changelog_reminder.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{check_changelog.yaml => changelog_reminder.yaml} (100%) diff --git a/.github/workflows/check_changelog.yaml b/.github/workflows/changelog_reminder.yaml similarity index 100% rename from .github/workflows/check_changelog.yaml rename to .github/workflows/changelog_reminder.yaml From dbc7ba7b80afde3f928f53259682cd50235545e4 Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Sun, 29 Oct 2023 17:59:27 +1000 Subject: [PATCH 05/10] Change trigger --- .github/workflows/changelog_reminder.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/changelog_reminder.yaml b/.github/workflows/changelog_reminder.yaml index 1ddd767933..ec8c939217 100644 --- a/.github/workflows/changelog_reminder.yaml +++ b/.github/workflows/changelog_reminder.yaml @@ -2,9 +2,6 @@ name: Verify changelog updated on: pull_request: - paths: - - '**.rst' - - '**.py' types: - opened - ready_for_review From fb6c1070254f81887eee4d80685db2d642589c14 Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Sun, 29 Oct 2023 18:11:03 +1000 Subject: [PATCH 06/10] Update version --- .github/workflows/changelog_reminder.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/changelog_reminder.yaml b/.github/workflows/changelog_reminder.yaml index ec8c939217..fb4c8e2785 100644 --- a/.github/workflows/changelog_reminder.yaml +++ b/.github/workflows/changelog_reminder.yaml @@ -11,8 +11,9 @@ jobs: check_changes: runs-on: ubuntu-latest steps: - - name: Checkout repo - uses: actions/checkout@v2 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 - name: Get changed files id: getfile @@ -25,7 +26,7 @@ jobs: echo "EOF" >> $GITHUB_ENV - name: Comment PR - uses: thollander/actions-comment-pull-request@master + uses: thollander/actions-comment-pull-request@v2 with: message: 'Thank you for the PR! The changelog has not been updated so here is a friendly reminder to check if you need at add an entry.' GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' From 8d7cb5c5958ec06a4c1a21a7165b1f610e4e838f Mon Sep 17 00:00:00 2001 From: Serene-Arc <33189705+Serene-Arc@users.noreply.github.com> Date: Sun, 29 Oct 2023 18:29:16 +1000 Subject: [PATCH 07/10] Change conditions --- .github/workflows/changelog_reminder.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog_reminder.yaml b/.github/workflows/changelog_reminder.yaml index fb4c8e2785..e0742ec15a 100644 --- a/.github/workflows/changelog_reminder.yaml +++ b/.github/workflows/changelog_reminder.yaml @@ -30,4 +30,4 @@ jobs: with: message: 'Thank you for the PR! The changelog has not been updated so here is a friendly reminder to check if you need at add an entry.' GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' - if: contains(fromJson(env.CHANGED_FILES), '.py') && !contains(fromJson(env.CHANGED_FILES), 'changelog.rst') + if: contains(env.CHANGED_FILES, '.py') && !contains(env.CHANGED_FILES, 'changelog.rst') From 29c062a81e0c830e9cc98e2f6db9601c5ba6fc99 Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Fri, 20 Oct 2023 15:06:38 +0200 Subject: [PATCH 08/10] Overhaul of pull-request template - Some notes only visible to the contributor while editing. - Some tiny fixes in the existing texts in braces. - One of the "invisible" notes encourages to remove those help-texts to help uncluttering. --- .github/pull_request_template.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 42cd8169b2..c3fc7766ad 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,6 +6,19 @@ Fixes #X. ## To Do -- [ ] Documentation. (If you've add a new command-line flag, for example, find the appropriate page under `docs/` to describe it.) -- [ ] Changelog. (Add an entry to `docs/changelog.rst` near the top of the document.) -- [ ] Tests. (Encouraged but not strictly required.) + + +- [ ] Documentation. (If you've added a new command-line flag, for example, find the appropriate page under `docs/` to describe it.) +- [ ] Changelog. (Add an entry to `docs/changelog.rst` to the bottom of one of the lists near the top of the document.) +- [ ] Tests. (Very much encouraged but not strictly required.) From a9ff449c71bf0ec710bfd936cd10a5b4fd37a98a Mon Sep 17 00:00:00 2001 From: Serene <33189705+Serene-Arc@users.noreply.github.com> Date: Mon, 30 Oct 2023 11:05:08 +1000 Subject: [PATCH 09/10] Update .github/workflows/changelog_reminder.yaml Co-authored-by: J0J0 Todos <2733783+JOJ0@users.noreply.github.com> --- .github/workflows/changelog_reminder.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/changelog_reminder.yaml b/.github/workflows/changelog_reminder.yaml index e0742ec15a..48b0f1d9a3 100644 --- a/.github/workflows/changelog_reminder.yaml +++ b/.github/workflows/changelog_reminder.yaml @@ -28,6 +28,6 @@ jobs: - name: Comment PR uses: thollander/actions-comment-pull-request@v2 with: - message: 'Thank you for the PR! The changelog has not been updated so here is a friendly reminder to check if you need at add an entry.' + message: 'Thank you for the PR! The changelog has not been updated, so here is a friendly reminder to check if you need to add an entry.' GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' if: contains(env.CHANGED_FILES, '.py') && !contains(env.CHANGED_FILES, 'changelog.rst') From 2af9a8c863f145cf4db2beda1090792cd35af8af Mon Sep 17 00:00:00 2001 From: J0J0 Todos Date: Mon, 30 Oct 2023 11:23:08 +0100 Subject: [PATCH 10/10] Fix a typo and reorder enum in PR template --- .github/pull_request_template.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c3fc7766ad..ef49ba5ad3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -10,13 +10,13 @@ Fixes #X. - If you believe one of below checkpoints is not required for the change you are submitting, cross it out and check the box nonetheless to let us know. For example: - [x] ~Changelog~ -- Please remove the descriptive sentences in braces from the enumeration below, - which helps to unclutter your PR description. - Regarding the changelog, often it makes sense to add your entry only once reviewing is finished. That way you might prevent conflicts from other PR's in - that file, as well as keep the chance high your description fits with what - the latest revision of your feature/fix. + that file, as well as keep the chance high your description fits with the + latest revision of your feature/fix. - Regarding documentation, bugfixes often don't require additions to the docs. +- Please remove the descriptive sentences in braces from the enumeration below, + which helps to unclutter your PR description. --> - [ ] Documentation. (If you've added a new command-line flag, for example, find the appropriate page under `docs/` to describe it.)