File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ from pathlib import Path
2+
3+
4+ WORKFLOW_PATH = Path (__file__ ).parents [2 ] / "workflows" / "ai-pr-review.yml"
5+
6+
7+ def test_ai_pr_review_caller_grants_reusable_workflow_permissions () -> None :
8+ workflow = WORKFLOW_PATH .read_text ()
9+
10+ required_permissions = (
11+ " ai-pr-review:\n "
12+ " permissions:\n "
13+ " contents: write\n "
14+ " id-token: write\n "
15+ " pull-requests: write\n "
16+ )
17+ assert required_permissions in workflow
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ permissions: {}
99jobs :
1010 ai-pr-review :
1111 permissions :
12- contents : read
12+ contents : write
1313 id-token : write
1414 pull-requests : write
1515 uses : aws/aws-durable-execution-ci/.github/workflows/ai-pr-review.yml@8de63fa646c1b7b778829126cf53b7874074795e
Original file line number Diff line number Diff line change 77 - ' .github/scripts/check_otel_wheel_dependencies.py'
88 - ' .github/scripts/parse_sdk_branch.py'
99 - ' .github/scripts/tests/**'
10+ - ' .github/workflows/ai-pr-review.yml'
1011 - ' .github/workflows/opentelemetry-conformance-tests.yml'
1112 - ' packages/aws-durable-execution-sdk-python-otel/pyproject.toml'
1213 push :
1617 - ' .github/scripts/check_otel_wheel_dependencies.py'
1718 - ' .github/scripts/parse_sdk_branch.py'
1819 - ' .github/scripts/tests/**'
20+ - ' .github/workflows/ai-pr-review.yml'
1921 - ' .github/workflows/opentelemetry-conformance-tests.yml'
2022 - ' packages/aws-durable-execution-sdk-python-otel/pyproject.toml'
2123
3436 - name : Run script tests
3537 run : |
3638 python -m pytest \
39+ .github/scripts/tests/test_ai_pr_review_workflow.py \
3740 .github/scripts/tests/test_build_lambda_layer.py \
3841 .github/scripts/tests/test_check_otel_wheel_dependencies.py \
3942 .github/scripts/tests/test_opentelemetry_conformance_workflow.py \
You can’t perform that action at this time.
0 commit comments