Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/scripts/tests/test_notify_workflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import re
from pathlib import Path


WORKFLOW_PATH = Path(__file__).parents[2] / "workflows" / "notify.yml"
SHARED_WORKFLOW_SHA = "6cade565b59817027aa0fe4949d5923286b6675c"


def test_notify_workflow_reuses_pinned_shared_implementation() -> None:
workflow = WORKFLOW_PATH.read_text()
match = re.search(r"(?ms)^ notify:\n(.*)\Z", workflow)

assert match is not None
notify_job = match.group(1)
assert (
"uses: aws/aws-durable-execution-ci/.github/workflows/notify.yml@"
f"{SHARED_WORKFLOW_SHA}"
) in notify_job
assert "contents: read" in notify_job
assert "models: read" in notify_job
assert "runs-on:" not in notify_job
assert "summarize_notification.py" not in notify_job
assert "SLACK_WEBHOOK_URL_PR" in notify_job
assert "SLACK_WEBHOOK_URL_ISSUE" in notify_job
assert "SLACK_WEBHOOK_URL_RELEASE" in notify_job
5 changes: 4 additions & 1 deletion .github/workflows/notify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ permissions: {}

jobs:
notify:
uses: aws/aws-durable-execution-ci/.github/workflows/notify.yml@71259cf476e37255752d8f9445a1a48ec92be1df
permissions:
contents: read
models: read
uses: aws/aws-durable-execution-ci/.github/workflows/notify.yml@6cade565b59817027aa0fe4949d5923286b6675c
secrets:
SLACK_WEBHOOK_URL_PR: ${{ secrets.SLACK_WEBHOOK_URL_PR }}
SLACK_WEBHOOK_URL_ISSUE: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/test-parser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ on:
- '.github/scripts/build_lambda_layer.py'
- '.github/scripts/parse_sdk_branch.py'
- '.github/scripts/tests/**'
- '.github/workflows/notify.yml'
push:
branches: [ main ]
paths:
- '.github/scripts/build_lambda_layer.py'
- '.github/scripts/parse_sdk_branch.py'
- '.github/scripts/tests/**'
- '.github/workflows/notify.yml'

permissions:
contents: read
Expand All @@ -29,4 +31,5 @@ jobs:
run: |
python -m pytest \
.github/scripts/tests/test_build_lambda_layer.py \
.github/scripts/tests/test_notify_workflow.py \
.github/scripts/tests/test_parse_sdk_branch.py
Loading