From 1308b6157d397ed600ae73a54a01f59b1f04fe73 Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:53:19 -0400 Subject: [PATCH 01/15] add attribution #148 --- .github/helper_scripts/post_check_results.py | 9 ++++++--- .github/workflows/checks.yml | 2 ++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/helper_scripts/post_check_results.py b/.github/helper_scripts/post_check_results.py index cbf7b32..0e39b4c 100644 --- a/.github/helper_scripts/post_check_results.py +++ b/.github/helper_scripts/post_check_results.py @@ -45,9 +45,12 @@ def CollectResults(): return rows, failed def PostResults(repo, run_id, rows, failed): - run_url = f"https://github.com/{repo}/actions/runs/{run_id}" - table = "\n".join(["| Check | Result | Time |", "|-------|--------|------|", *rows]) - body = f"**Check Results** ([run details]({run_url}))\n\n{table}" + run_url = f"https://github.com/{repo}/actions/runs/{run_id}" + comment_author = os.environ.get("COMMENT_AUTHOR", "") + comment_url = os.environ.get("COMMENT_URL", "") + table = "\n".join(["| Check | Result | Time |", "|-------|--------|------|", *rows]) + attribution = f"Triggered by @{comment_author} on [this comment]({comment_url})\n\n" if comment_author else "" + body = f"{attribution}**Check Results** ([run details]({run_url}))\n\n{table}" pr_num = os.environ["PR_NUMBER"] pr_sha = os.environ["PR_SHA"] subprocess.run([ diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 44e3cc6..154f026 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -91,6 +91,8 @@ jobs: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ github.event.issue.number }} PR_SHA: ${{ env.PR_SHA }} + COMMENT_AUTHOR: ${{ github.event.comment.user.login }} + COMMENT_URL: ${{ github.event.comment.html_url }} run: | python .github/helper_scripts/post_check_results.py \ ${{ contains(github.event.comment.body, '--post') && '--post' || '' }} From 889fa62693c65fe13b36764164c3791ae516089c Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Mon, 6 Apr 2026 18:56:07 -0400 Subject: [PATCH 02/15] #148 Include merge commit sha --- .github/helper_scripts/pr_close_comment.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/helper_scripts/pr_close_comment.py b/.github/helper_scripts/pr_close_comment.py index 8685ff1..ace50ed 100644 --- a/.github/helper_scripts/pr_close_comment.py +++ b/.github/helper_scripts/pr_close_comment.py @@ -19,18 +19,22 @@ def Main(): repo = Github(github_token).get_repo(repo_name) pr = repo.get_pull(pr_number) - issue_comment_url = PostCommentOnIssueThread(repo, branch_name, last_commit_sha) + merge_commit_sha = pr.merge_commit_sha + issue_comment_url = PostCommentOnIssueThread(repo, branch_name, last_commit_sha, merge_commit_sha) PostCommentOnPRThread(pr, user_closing_pr, issue_comment_url) return 0 -def PostCommentOnIssueThread(repo, branch_name, last_commit_sha): +def PostCommentOnIssueThread(repo, branch_name, last_commit_sha, merge_commit_sha): issue_match = re.match(r"^(\d+)", branch_name) if not issue_match: return None issue_number = int(issue_match.group(1)) - issue_body = ISSUE_TEMPLATE.read_text() + f"\n\nLast commit in issue branch: {last_commit_sha}" + issue_body = ISSUE_TEMPLATE.read_text() + issue_body += f"\n\nLast commit in issue branch: {last_commit_sha}" + if merge_commit_sha: + issue_body += f"\n\nMerge commit: {merge_commit_sha}" comment = repo.get_issue(issue_number).create_comment(issue_body) return comment.html_url From d2b5941dbd66d2ed12799349d6439c1f8b5c6b11 Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Mon, 6 Apr 2026 19:01:51 -0400 Subject: [PATCH 03/15] check for issue subfolder #148 --- .github/checks/check_issue_folder.py | 23 +++++++++++++++++++++++ .github/checks/checks.json | 9 +++++---- .github/workflows/checks.yml | 9 +++++++++ 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 .github/checks/check_issue_folder.py diff --git a/.github/checks/check_issue_folder.py b/.github/checks/check_issue_folder.py new file mode 100644 index 0000000..267742b --- /dev/null +++ b/.github/checks/check_issue_folder.py @@ -0,0 +1,23 @@ +#!/usr/bin/env python3 +import subprocess +import sys + + +def Main(): + files = subprocess.run( + ["git", "ls-files", "issue/"], + stdout=subprocess.PIPE, check=True + ).stdout.decode().splitlines() + + if files: + print("This pull includes an issue subdirectory. Please remove prior to merging.") + for f in files: + print(" -", f) + return 1 + + print("No issue/ files found.") + return 0 + + +if __name__ == "__main__": + sys.exit(Main()) diff --git a/.github/checks/checks.json b/.github/checks/checks.json index a0f40dc..0869034 100644 --- a/.github/checks/checks.json +++ b/.github/checks/checks.json @@ -1,6 +1,7 @@ [ - {"name": "SCons DAG", "command": "/run-actions-dag"}, - {"name": "Newlines", "command": "/run-actions-newlines"}, - {"name": "EPS data", "command": "/run-actions-eps"}, - {"name": "Build log", "command": "/run-actions-log"} + {"name": "SCons DAG", "command": "/run-actions-dag"}, + {"name": "Newlines", "command": "/run-actions-newlines"}, + {"name": "EPS data", "command": "/run-actions-eps"}, + {"name": "Build log", "command": "/run-actions-log"}, + {"name": "Issue folder", "command": "/run-actions-issue-folder"} ] diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 154f026..fe9fda7 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -85,6 +85,15 @@ jobs: script: .github/checks/check_sconscript_log.py display: Build log + - id: check_issue_folder + name: Check for issue folder + if: contains(fromJSON(steps.parse_commands.outputs.run), 'Issue folder') + continue-on-error: true + uses: ./.github/actions/timed-check + with: + script: .github/checks/check_issue_folder.py + display: Issue folder + - name: Post results if: always() env: From 55af08c73f74594792af56231607456c500fc693 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:08:57 -0400 Subject: [PATCH 04/15] #148 bd branch protection + check if issue/ is empty --- .github/workflows/check-issue.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 .github/workflows/check-issue.yml diff --git a/.github/workflows/check-issue.yml b/.github/workflows/check-issue.yml new file mode 100644 index 0000000..def5fe8 --- /dev/null +++ b/.github/workflows/check-issue.yml @@ -0,0 +1,20 @@ +name: Check issue/ is empty + +on: + pull_request: + branches: [main, master] + types: [labeled] + +jobs: + check-issue: + if: github.event.label.name == 'ready-to-merge' + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Fail if issue/ is non-empty + run: | + if [ -d "issue" ] && [ -n "$(ls -A issue/)" ]; then + echo "issue/ is not empty. Please delete its contents before merging." + exit 1 + fi + echo "issue/ is empty or does not exist." From aecaa03dd5667ea43b0bb8be02321c3513852dc2 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Fri, 17 Apr 2026 17:39:53 -0400 Subject: [PATCH 05/15] #148 bd run check upon PR opening --- .github/workflows/check-issue.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-issue.yml b/.github/workflows/check-issue.yml index def5fe8..4e600fc 100644 --- a/.github/workflows/check-issue.yml +++ b/.github/workflows/check-issue.yml @@ -3,11 +3,11 @@ name: Check issue/ is empty on: pull_request: branches: [main, master] - types: [labeled] + types: [opened, labeled] jobs: check-issue: - if: github.event.label.name == 'ready-to-merge' + if: github.event.action == 'opened' || github.event.label.name == 'ready-to-merge' runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From d1a3e8ccbd52275d46d2a8aec316cd33953b6315 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Thu, 23 Apr 2026 17:19:43 -0400 Subject: [PATCH 06/15] #148 bd have check-issue triggered by comment --- .github/workflows/check-issue.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-issue.yml b/.github/workflows/check-issue.yml index 4e600fc..68e0a33 100644 --- a/.github/workflows/check-issue.yml +++ b/.github/workflows/check-issue.yml @@ -3,14 +3,20 @@ name: Check issue/ is empty on: pull_request: branches: [main, master] - types: [opened, labeled] + types: [opened] + issue_comment: + types: [created] jobs: check-issue: - if: github.event.action == 'opened' || github.event.label.name == 'ready-to-merge' + if: | + github.event_name == 'pull_request' || + (github.event_name == 'issue_comment' && github.event.issue.pull_request && (contains(github.event.comment.body, '/run-actions-issue') || contains(github.event.comment.body, '/run-actions-all'))) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || github.sha }} - name: Fail if issue/ is non-empty run: | if [ -d "issue" ] && [ -n "$(ls -A issue/)" ]; then From 4243ca9116906dd7ed0aa271d9859e260f5fab9c Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Fri, 24 Apr 2026 10:50:42 -0400 Subject: [PATCH 07/15] Revert "check for issue subfolder #148" This reverts commit d2b5941dbd66d2ed12799349d6439c1f8b5c6b11. --- .github/checks/check_issue_folder.py | 23 ----------------------- .github/checks/checks.json | 9 ++++----- .github/workflows/checks.yml | 9 --------- 3 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 .github/checks/check_issue_folder.py diff --git a/.github/checks/check_issue_folder.py b/.github/checks/check_issue_folder.py deleted file mode 100644 index 267742b..0000000 --- a/.github/checks/check_issue_folder.py +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env python3 -import subprocess -import sys - - -def Main(): - files = subprocess.run( - ["git", "ls-files", "issue/"], - stdout=subprocess.PIPE, check=True - ).stdout.decode().splitlines() - - if files: - print("This pull includes an issue subdirectory. Please remove prior to merging.") - for f in files: - print(" -", f) - return 1 - - print("No issue/ files found.") - return 0 - - -if __name__ == "__main__": - sys.exit(Main()) diff --git a/.github/checks/checks.json b/.github/checks/checks.json index 0869034..a0f40dc 100644 --- a/.github/checks/checks.json +++ b/.github/checks/checks.json @@ -1,7 +1,6 @@ [ - {"name": "SCons DAG", "command": "/run-actions-dag"}, - {"name": "Newlines", "command": "/run-actions-newlines"}, - {"name": "EPS data", "command": "/run-actions-eps"}, - {"name": "Build log", "command": "/run-actions-log"}, - {"name": "Issue folder", "command": "/run-actions-issue-folder"} + {"name": "SCons DAG", "command": "/run-actions-dag"}, + {"name": "Newlines", "command": "/run-actions-newlines"}, + {"name": "EPS data", "command": "/run-actions-eps"}, + {"name": "Build log", "command": "/run-actions-log"} ] diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index fe9fda7..154f026 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -85,15 +85,6 @@ jobs: script: .github/checks/check_sconscript_log.py display: Build log - - id: check_issue_folder - name: Check for issue folder - if: contains(fromJSON(steps.parse_commands.outputs.run), 'Issue folder') - continue-on-error: true - uses: ./.github/actions/timed-check - with: - script: .github/checks/check_issue_folder.py - display: Issue folder - - name: Post results if: always() env: From 165438ab0b4d46effb3cb1add6b9adc95802f87f Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Fri, 24 Apr 2026 10:57:42 -0400 Subject: [PATCH 08/15] #148 [run-actions-issue] --- issue/test.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 issue/test.txt diff --git a/issue/test.txt b/issue/test.txt new file mode 100644 index 0000000..3b18e51 --- /dev/null +++ b/issue/test.txt @@ -0,0 +1 @@ +hello world From 10be7aa57e9d437f71be29a368b872630a0d7db7 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Sat, 25 Apr 2026 09:24:07 -0500 Subject: [PATCH 09/15] #148 bd allow commit message trigger for issue/ check --- .github/workflows/check-issue.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/check-issue.yml b/.github/workflows/check-issue.yml index 68e0a33..5e3240d 100644 --- a/.github/workflows/check-issue.yml +++ b/.github/workflows/check-issue.yml @@ -4,6 +4,9 @@ on: pull_request: branches: [main, master] types: [opened] + push: + branches: + - "**" issue_comment: types: [created] @@ -11,6 +14,7 @@ jobs: check-issue: if: | github.event_name == 'pull_request' || + (github.event_name == 'push' && (contains(github.event.head_commit.message, '[run-actions-all]') || contains(github.event.head_commit.message, '[run-actions-issue]'))) || (github.event_name == 'issue_comment' && github.event.issue.pull_request && (contains(github.event.comment.body, '/run-actions-issue') || contains(github.event.comment.body, '/run-actions-all'))) runs-on: ubuntu-latest steps: From 9a9cacec9bc5318d19735dbec9233aa4824d6391 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Sat, 25 Apr 2026 09:24:59 -0500 Subject: [PATCH 10/15] #148 [run-actions-issue] --- issue/test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/issue/test.txt b/issue/test.txt index 3b18e51..fecf5b1 100644 --- a/issue/test.txt +++ b/issue/test.txt @@ -1 +1 @@ -hello world +placehold From 9cd3a164e32fe5456fdacb680f6724af78bf935a Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Fri, 8 May 2026 16:23:57 -0400 Subject: [PATCH 11/15] #148 [run-test-issue] --- issue/test.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/issue/test.txt b/issue/test.txt index fecf5b1..2a0073a 100644 --- a/issue/test.txt +++ b/issue/test.txt @@ -1 +1,2 @@ placehold + From b33b6d0f2be135ede1a697c01a267e1bb20a3b35 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Fri, 8 May 2026 16:24:48 -0400 Subject: [PATCH 12/15] #148 [run-actions-issue] This reverts commit 9cd3a164e32fe5456fdacb680f6724af78bf935a. --- issue/test.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/issue/test.txt b/issue/test.txt index 2a0073a..fecf5b1 100644 --- a/issue/test.txt +++ b/issue/test.txt @@ -1,2 +1 @@ placehold - From aadbc7cbbb36384042f32dba00c2974df27df030 Mon Sep 17 00:00:00 2001 From: zhizhongpu <84325421+zhizhongpu@users.noreply.github.com> Date: Fri, 8 May 2026 16:25:55 -0400 Subject: [PATCH 13/15] #148 remove issue/ --- issue/test.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 issue/test.txt diff --git a/issue/test.txt b/issue/test.txt deleted file mode 100644 index fecf5b1..0000000 --- a/issue/test.txt +++ /dev/null @@ -1 +0,0 @@ -placehold From a9b9afede1a9374d09c2f387ddda5bd48fae2276 Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Fri, 8 May 2026 16:37:57 -0400 Subject: [PATCH 14/15] test #156 --- issue/test copy.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 issue/test copy.txt diff --git a/issue/test copy.txt b/issue/test copy.txt new file mode 100644 index 0000000..fecf5b1 --- /dev/null +++ b/issue/test copy.txt @@ -0,0 +1 @@ +placehold From e24caf4719280e3e6603f6df80a02e0cdef4480a Mon Sep 17 00:00:00 2001 From: Chris Liao <33707455+liaochris@users.noreply.github.com> Date: Fri, 8 May 2026 16:42:59 -0400 Subject: [PATCH 15/15] [run-actions-all] #156 --- issue/test copy.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 issue/test copy.txt diff --git a/issue/test copy.txt b/issue/test copy.txt deleted file mode 100644 index fecf5b1..0000000 --- a/issue/test copy.txt +++ /dev/null @@ -1 +0,0 @@ -placehold