feat: trust core team commits and verified bot commits in run-ci label validation #26911
+99
−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.
What does this PR do?
Updates the
run-cilabel validation logic to trust commits made after the label was added if they come from trusted sources:devin-ai-integration[bot],cubic-dev-ai[bot]) with verified commit signaturesPreviously, when the
run-cilabel was "stale" (added before new commits were pushed), the PR would be marked as untrusted. Now, if all commits after the label are from trusted sources, the PR remains trusted.Security model: Bot commits must be verified (signed by GitHub) to be trusted. This prevents external contributors from spoofing bot commits by setting their git author name to a bot name - they cannot forge a verified commit signature that GitHub creates when commits are made via the GitHub API.
How should this be tested?
This is a GitHub Actions workflow change that will be tested in production when the scenario occurs:
run-cilabelManual verification: Review the logic flow and security assumptions in the code.
Mandatory Tasks (DO NOT REMOVE)
Human Review Checklist
devin-ai-integration[bot],cubic-dev-ai[bot]) is correctcompareCommitsAPI response structure assumptions (author.type, commit.verification)runAtLabelTimeis not foundLink to Devin run: https://app.devin.ai/sessions/dd01a0464a1445a18ded1bb9be7b59ed
Requested by: @keithwillcode