From 742fdc5844115a8c76f115b6332d326b6e248d32 Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:38:41 -0400 Subject: [PATCH 1/9] CI testing v1 --- .github/workflows/pr-check.yaml | 19 +++++++++++++++++++ .github/workflows/pr_description_check.py | 5 +++++ 2 files changed, 24 insertions(+) create mode 100644 .github/workflows/pr-check.yaml create mode 100644 .github/workflows/pr_description_check.py diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml new file mode 100644 index 0000000..d525fc8 --- /dev/null +++ b/.github/workflows/pr-check.yaml @@ -0,0 +1,19 @@ +# .github/workflows/check-target.yaml +name: All +on: + pull_request: + types: [opened, edited, synchronize, reopened, labeled, unlabeled] +jobs: + check_target: + runs-on: ubuntu-latest + steps: + - name: Pull request description mentions every changed file + env: + PR_BODY: ${{ github.event.pull_request.body }} + GH_TOKEN: ${{ github.token }} + run: | + gh pr diff ${{ github.event.pull_request.number }} \ + --repo ${{ github.repository }} --name-only > tmp_changed_files.txt + run: | + python3 .github/workflows/pr_description_check.py + \ No newline at end of file diff --git a/.github/workflows/pr_description_check.py b/.github/workflows/pr_description_check.py new file mode 100644 index 0000000..cd9cdf8 --- /dev/null +++ b/.github/workflows/pr_description_check.py @@ -0,0 +1,5 @@ +import os +print(os.environ["PR_BODY"]) + +with open("tmp_changed_files.txt") as f: + print(f.read()) \ No newline at end of file From 5ba37ccb36c8da8c26b5e22c1b39e71d607f7120 Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:40:24 -0400 Subject: [PATCH 2/9] Fix name --- .github/workflows/pr-check.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml index d525fc8..f0c9e7b 100644 --- a/.github/workflows/pr-check.yaml +++ b/.github/workflows/pr-check.yaml @@ -1,5 +1,5 @@ # .github/workflows/check-target.yaml -name: All +name: PR Description Check on: pull_request: types: [opened, edited, synchronize, reopened, labeled, unlabeled] From 96b53875dcec8338642f34915a83937473a8b478 Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:41:39 -0400 Subject: [PATCH 3/9] Fix 2 --- .github/workflows/check-target.yaml | 14 +++++++++++++- .github/workflows/pr-check.yaml | 19 ------------------- 2 files changed, 13 insertions(+), 20 deletions(-) delete mode 100644 .github/workflows/pr-check.yaml diff --git a/.github/workflows/check-target.yaml b/.github/workflows/check-target.yaml index 8bbbc52..c034627 100644 --- a/.github/workflows/check-target.yaml +++ b/.github/workflows/check-target.yaml @@ -16,4 +16,16 @@ jobs: echo "Targeting main requires the 'release' label" echo "::error::Please change your target branch to the current working update branch (e.g. maizebus2.1). See https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/changing-the-base-branch-of-a-pull-request" exit 1 - fi \ No newline at end of file + fi + check-description: + runs-on: ubuntu-latest + steps: + - name: Pull request description mentions every changed file + env: + PR_BODY: ${{ github.event.pull_request.body }} + GH_TOKEN: ${{ github.token }} + run: | + gh pr diff ${{ github.event.pull_request.number }} \ + --repo ${{ github.repository }} --name-only > tmp_changed_files.txt + run: | + python3 .github/workflows/pr_description_check.py \ No newline at end of file diff --git a/.github/workflows/pr-check.yaml b/.github/workflows/pr-check.yaml deleted file mode 100644 index f0c9e7b..0000000 --- a/.github/workflows/pr-check.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# .github/workflows/check-target.yaml -name: PR Description Check -on: - pull_request: - types: [opened, edited, synchronize, reopened, labeled, unlabeled] -jobs: - check_target: - runs-on: ubuntu-latest - steps: - - name: Pull request description mentions every changed file - env: - PR_BODY: ${{ github.event.pull_request.body }} - GH_TOKEN: ${{ github.token }} - run: | - gh pr diff ${{ github.event.pull_request.number }} \ - --repo ${{ github.repository }} --name-only > tmp_changed_files.txt - run: | - python3 .github/workflows/pr_description_check.py - \ No newline at end of file From 97a5fcec7d22742fdedc61a9ccd3ab29ceed9bc6 Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:44:40 -0400 Subject: [PATCH 4/9] Fix invalid YAML --- .github/workflows/check-target.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-target.yaml b/.github/workflows/check-target.yaml index c034627..22f6324 100644 --- a/.github/workflows/check-target.yaml +++ b/.github/workflows/check-target.yaml @@ -20,6 +20,7 @@ jobs: check-description: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v6 - name: Pull request description mentions every changed file env: PR_BODY: ${{ github.event.pull_request.body }} @@ -27,5 +28,4 @@ jobs: run: | gh pr diff ${{ github.event.pull_request.number }} \ --repo ${{ github.repository }} --name-only > tmp_changed_files.txt - run: | python3 .github/workflows/pr_description_check.py \ No newline at end of file From 9fca266ae9baf9ac470aa0467f41b108669206bd Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:58:37 -0400 Subject: [PATCH 5/9] Work on PR description check --- .github/workflows/check-description.yaml | 18 ++++++++++ .github/workflows/check-target.yaml | 12 ------- .github/workflows/pr_description_check.py | 40 +++++++++++++++++++++-- 3 files changed, 56 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/check-description.yaml diff --git a/.github/workflows/check-description.yaml b/.github/workflows/check-description.yaml new file mode 100644 index 0000000..76ef242 --- /dev/null +++ b/.github/workflows/check-description.yaml @@ -0,0 +1,18 @@ +# .github/workflows/check-target.yaml +name: Description mentions every changed file +on: + pull_request: + types: [opened, edited, synchronize, reopened, labeled, unlabeled] +jobs: + check-description: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Pull request description mentions every changed file + env: + PR_BODY: ${{ github.event.pull_request.body }} + GH_TOKEN: ${{ github.token }} + run: | + gh pr diff ${{ github.event.pull_request.number }} \ + --repo ${{ github.repository }} --name-only > tmp_changed_files.txt + python3 .github/workflows/pr_description_check.py diff --git a/.github/workflows/check-target.yaml b/.github/workflows/check-target.yaml index 22f6324..064d72d 100644 --- a/.github/workflows/check-target.yaml +++ b/.github/workflows/check-target.yaml @@ -17,15 +17,3 @@ jobs: echo "::error::Please change your target branch to the current working update branch (e.g. maizebus2.1). See https://docs.github.com/en/pull-requests/how-tos/create-pull-requests/changing-the-base-branch-of-a-pull-request" exit 1 fi - check-description: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v6 - - name: Pull request description mentions every changed file - env: - PR_BODY: ${{ github.event.pull_request.body }} - GH_TOKEN: ${{ github.token }} - run: | - gh pr diff ${{ github.event.pull_request.number }} \ - --repo ${{ github.repository }} --name-only > tmp_changed_files.txt - python3 .github/workflows/pr_description_check.py \ No newline at end of file diff --git a/.github/workflows/pr_description_check.py b/.github/workflows/pr_description_check.py index cd9cdf8..d6b8f43 100644 --- a/.github/workflows/pr_description_check.py +++ b/.github/workflows/pr_description_check.py @@ -1,5 +1,41 @@ import os -print(os.environ["PR_BODY"]) + +BLACK = "\033[0;30m"; +RED = "\033[0;31m"; +GREEN = "\033[0;32m"; +YELLOW = "\033[0;33m"; +BLUE = "\033[0;34m"; +MAGENTA = "\033[0;35m"; +CYAN = "\033[0;36m"; +WHITE = "\033[0;37m"; +RESET = "\033[0m"; + +# print(os.environ["PR_BODY"]) + +# Run gh pr diff 119 \ +# Description here +# .github/workflows/check-target.yaml +# .github/workflows/pr_description_check.py + +pr_body = os.environ["PR_BODY"] +# pr_body = "Description here\nThis is some text, yay!\npr_description_check.py" + +all_accounted_for = True with open("tmp_changed_files.txt") as f: - print(f.read()) \ No newline at end of file + lines = f.read().split("\n") + for line in lines: + parts = line.split("/") + filename = parts[len(parts) - 1] + if filename in pr_body: + print(GREEN+"✓ Changed file "+filename+" in PR description"+RESET) + else: + all_accounted_for = False + print(RED+"✗ Changed file "+filename+" not found in PR description"+RESET) + + +if all_accounted_for: + exit(0) +else: + print("::error::Please make sure all changed files are listed in your pull request description. See above for details") + exit(1) From 4ad4c40af19c36685713c37bd511add659fbf232 Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 13:59:35 -0400 Subject: [PATCH 6/9] Skipped empty lines --- .github/workflows/pr_description_check.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/pr_description_check.py b/.github/workflows/pr_description_check.py index d6b8f43..d65818d 100644 --- a/.github/workflows/pr_description_check.py +++ b/.github/workflows/pr_description_check.py @@ -25,6 +25,8 @@ with open("tmp_changed_files.txt") as f: lines = f.read().split("\n") for line in lines: + if line.trim() == "": + continue # Skip empty lines parts = line.split("/") filename = parts[len(parts) - 1] if filename in pr_body: From 705cbd3d386c7d2428ac7dd9cd2b16a05b218dbc Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:00:20 -0400 Subject: [PATCH 7/9] Test 3 --- .github/workflows/pr_description_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_description_check.py b/.github/workflows/pr_description_check.py index d65818d..ec7e672 100644 --- a/.github/workflows/pr_description_check.py +++ b/.github/workflows/pr_description_check.py @@ -25,7 +25,7 @@ with open("tmp_changed_files.txt") as f: lines = f.read().split("\n") for line in lines: - if line.trim() == "": + if line.strip() == "": continue # Skip empty lines parts = line.split("/") filename = parts[len(parts) - 1] From 26e336dbaa94b60ae5afbbfa18c531067a464b2d Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:03:40 -0400 Subject: [PATCH 8/9] Tweaked error message --- .github/workflows/pr_description_check.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_description_check.py b/.github/workflows/pr_description_check.py index ec7e672..8211df6 100644 --- a/.github/workflows/pr_description_check.py +++ b/.github/workflows/pr_description_check.py @@ -39,5 +39,5 @@ if all_accounted_for: exit(0) else: - print("::error::Please make sure all changed files are listed in your pull request description. See above for details") + print("::error::Please edit your pull request description to make sure it lists all changed files. See above for details") exit(1) From b125f8b696e05415b5e8db425c7abd93648341fd Mon Sep 17 00:00:00 2001 From: iswheeler <22535264+iswheeler@users.noreply.github.com> Date: Wed, 7 Oct 2026 14:33:36 -0400 Subject: [PATCH 9/9] Removed dead lines --- .github/workflows/pr_description_check.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/pr_description_check.py b/.github/workflows/pr_description_check.py index 8211df6..5e7f69c 100644 --- a/.github/workflows/pr_description_check.py +++ b/.github/workflows/pr_description_check.py @@ -10,15 +10,7 @@ WHITE = "\033[0;37m"; RESET = "\033[0m"; -# print(os.environ["PR_BODY"]) - -# Run gh pr diff 119 \ -# Description here -# .github/workflows/check-target.yaml -# .github/workflows/pr_description_check.py - pr_body = os.environ["PR_BODY"] -# pr_body = "Description here\nThis is some text, yay!\npr_description_check.py" all_accounted_for = True