Repository navigation
Treat corporate commit emails as warnings in email-privacy-exempt repos - #2
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 change?
In repositories marked with the org custom property
email-privacy-exempt=true(today onlyswitch), a corporate email in a commit's author, committer or message becomes a warning instead of a failure. The secret scan is unchanged and still fails the check. Every other repository keeps the strict rule.Why
The org ruleset that requires this workflow (26167854, evaluate) excludes exempt repos, copying the "Email filter" rulesets. That leaves
switch, the most active public repo, with no secret scanning from this check at all. Replaying the check overswitch(152 open PRs, 244 merged in the last 30 days):With this change
switchcan be brought under the ruleset for secrets without blocking most of its PRs on email.How
The metadata step reads
GET /repos/{repo}/properties/valueswith the job'sgithub.token(metadata read, which every token has), and treats the repo as exempt only whenemail-privacy-exemptis exactly"true". If the call fails for any reason it prints a warning and applies the strict rule, so an API error can't turn the email check off. The value comes from the API, not from the PR, so a PR can't change it. When exempt, the step summary says so.Testing
switch→ exempt;.github,switch-trust-sdk-py→ strict; a nonexistent repo → warning plus strict.actionlintclean; YAML parses.github.tokencan read custom property values in a required-workflow run is confirmed on the first evaluate-mode run inswitchafter the ruleset is updated; if it can't,switchfails strict (safe direction) and the step prints the warning.Tracking: INFOSEC-652.
🤖 Generated with Claude Code