chore: prlinter not triggered when "Codebuild PR Build" completes #36057
+14
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added steps to save and upload pull request information.
Issue # (if applicable)
Closes #36055
Reason for this change
THE PROBLEM:
PR Linter can't determine which PR to validate because:
THE SOLUTION:
Add these steps to codebuild-pr-build.yml:
WHY IT WORKS:
KEY INSIGHT:
CONTEXT AVAILABILITY:
Codebuild PR Build (pull_request trigger):
✓ github.event.pull_request.number
✓ github.event.pull_request.head.sha
✓ github.event.pull_request.* (all PR data)
PR Linter (workflow_run trigger):
✗ github.event.pull_request (doesn't exist)
✗ github.event.workflow_run.pull_requests (empty array)
✓ github.event.workflow_run.id (can download artifacts)
ARTIFACT AS BRIDGE:
EXECUTION FLOW WITH FIX:
SUMMARY:
The solution works because it:
See #36055 for details
How do I validate
Test Environment
Validated on fork repository: pahud#16
Validation Steps
codebuild-pr-build.yml(artifact upload steps)pr_infoartifact successfullyResults
✅ Codebuild PR Build: Successfully uploaded
pr_infoartifact containing:pr_number: 16pr_sha: ebeaa4c...✅ PR Linter: Successfully validated PR and applied label
pr/needs-community-reviewEvidence
Before fix:
pr_infoartifact availableAfter fix:
pr_infoartifactNote on Fork Testing
For fork testing only, I added a
pull_request_targetfallback topr-linter.ymlsinceworkflow_runevents don't trigger from fork workflows. This fallback is not needed for aws/aws-cdk as workflows run in the base repository context whereworkflow_runworks correctly.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license