From 18fc54fa7a40c8b91d866fda13f6a82fdf590409 Mon Sep 17 00:00:00 2001 From: Silan He <16982279+SilanHe@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:00:40 +0000 Subject: [PATCH 1/4] ci: notify Slack on closed issue comments --- .github/workflows/closed-issue-comment.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/closed-issue-comment.yml diff --git a/.github/workflows/closed-issue-comment.yml b/.github/workflows/closed-issue-comment.yml new file mode 100644 index 000000000..74d67f693 --- /dev/null +++ b/.github/workflows/closed-issue-comment.yml @@ -0,0 +1,13 @@ +name: Closed Issue Comment + +on: + issue_comment: + types: [created] + +permissions: {} + +jobs: + closed-issue-comment: + uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e58bed1d3937c563c3fcb3a8d5e3c7838d1efdbe + secrets: + SLACK_WEBHOOK_URL_ISSUE: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} From a0ef4d2d63492cf2501517e6ae05919669c38daa Mon Sep 17 00:00:00 2001 From: Silan He <16982279+SilanHe@users.noreply.github.com> Date: Tue, 17 Nov 2026 22:34:11 +0000 Subject: [PATCH 2/4] ci: pin closed-issue-comment to main --- .github/workflows/closed-issue-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/closed-issue-comment.yml b/.github/workflows/closed-issue-comment.yml index 74d67f693..ff65113d0 100644 --- a/.github/workflows/closed-issue-comment.yml +++ b/.github/workflows/closed-issue-comment.yml @@ -8,6 +8,6 @@ permissions: {} jobs: closed-issue-comment: - uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e58bed1d3937c563c3fcb3a8d5e3c7838d1efdbe + uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e04e810d6d7e452377bbefc04f007ad7373d19e2 secrets: SLACK_WEBHOOK_URL_ISSUE: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} From 8e9eaa0a0d52d34bcd373ba6293cc7f0a1cab7f7 Mon Sep 17 00:00:00 2001 From: Silan He <16982279+SilanHe@users.noreply.github.com> Date: Wed, 18 Nov 2026 18:18:52 +0000 Subject: [PATCH 3/4] ci: pin closed-issue-comment to v0.6.0 --- .github/workflows/closed-issue-comment.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/closed-issue-comment.yml b/.github/workflows/closed-issue-comment.yml index ff65113d0..b5ddefe03 100644 --- a/.github/workflows/closed-issue-comment.yml +++ b/.github/workflows/closed-issue-comment.yml @@ -8,6 +8,6 @@ permissions: {} jobs: closed-issue-comment: - uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e04e810d6d7e452377bbefc04f007ad7373d19e2 + uses: aws/aws-durable-execution-ci/.github/workflows/closed-issue-comment.yml@e04e810d6d7e452377bbefc04f007ad7373d19e2 # v0.6.0 secrets: SLACK_WEBHOOK_URL_ISSUE: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }} From 4f083b2a575e449da9d4a41d0c295f0f1e697a59 Mon Sep 17 00:00:00 2001 From: Silan He <16982279+SilanHe@users.noreply.github.com> Date: Wed, 18 Nov 2026 18:31:08 +0000 Subject: [PATCH 4/4] test(ci): cover closed-issue-comment caller --- .../test_closed_issue_comment_workflow.py | 48 +++++++++++++++++++ .github/workflows/test-parser.yml | 2 + 2 files changed, 50 insertions(+) create mode 100644 .github/scripts/tests/test_closed_issue_comment_workflow.py diff --git a/.github/scripts/tests/test_closed_issue_comment_workflow.py b/.github/scripts/tests/test_closed_issue_comment_workflow.py new file mode 100644 index 000000000..e14c83ebb --- /dev/null +++ b/.github/scripts/tests/test_closed_issue_comment_workflow.py @@ -0,0 +1,48 @@ +import re +from pathlib import Path +from typing import Any + +import pytest +import yaml + +WORKFLOW_PATH = Path(__file__).parents[2] / "workflows" / "closed-issue-comment.yml" +TEST_PARSER_PATH = Path(__file__).parents[2] / "workflows" / "test-parser.yml" + + +@pytest.fixture(name="workflow") +def workflow_fixture() -> dict[Any, Any]: + return yaml.safe_load(WORKFLOW_PATH.read_text()) + + +def test_runs_on_new_issue_comments_only(workflow: dict[Any, Any]) -> None: + # PyYAML reads the bare key `on` as the boolean True. + assert workflow[True] == {"issue_comment": {"types": ["created"]}} + + +def test_calls_shared_workflow_pinned_to_commit(workflow: dict[Any, Any]) -> None: + uses = workflow["jobs"]["closed-issue-comment"]["uses"] + + assert re.fullmatch( + r"aws/aws-durable-execution-ci/\.github/workflows/closed-issue-comment\.yml" + r"@[0-9a-f]{40}", + uses, + ) + + +def test_passes_issue_webhook_secret(workflow: dict[Any, Any]) -> None: + secrets = workflow["jobs"]["closed-issue-comment"]["secrets"] + + assert secrets == {"SLACK_WEBHOOK_URL_ISSUE": "${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}"} + + +def test_grants_no_token_permissions(workflow: dict[Any, Any]) -> None: + assert workflow["permissions"] == {} + assert "permissions" not in workflow["jobs"]["closed-issue-comment"] + + +def test_workflow_triggers_script_tests() -> None: + parser = yaml.safe_load(TEST_PARSER_PATH.read_text()) + path = ".github/workflows/closed-issue-comment.yml" + + assert path in parser[True]["pull_request"]["paths"] + assert path in parser[True]["push"]["paths"] diff --git a/.github/workflows/test-parser.yml b/.github/workflows/test-parser.yml index 8acd5159e..dce3ee15a 100644 --- a/.github/workflows/test-parser.yml +++ b/.github/workflows/test-parser.yml @@ -11,6 +11,7 @@ on: - '.github/scripts/js_examples/**' - '.github/scripts/tests/**' - '.github/workflows/ai-pr-review.yml' + - '.github/workflows/closed-issue-comment.yml' - '.github/workflows/issue-triage.yml' - '.github/workflows/notify.yml' - '.github/workflows/stale-issue-closer.yml' @@ -30,6 +31,7 @@ on: - '.github/scripts/js_examples/**' - '.github/scripts/tests/**' - '.github/workflows/ai-pr-review.yml' + - '.github/workflows/closed-issue-comment.yml' - '.github/workflows/issue-triage.yml' - '.github/workflows/notify.yml' - '.github/workflows/stale-issue-closer.yml'