Which expression determines if a workflow is running in a private repository?
Select an answer to reveal the explanation.
Short Explanation and Infographic
Repository details like visibility are in the event payload under github.event.repository — not directly on the github context.
Full explanation below image
Full Explanation
The 'github.event' context contains the full webhook event payload, including 'github.event.repository' which has repository details like 'private' (boolean), 'full_name', 'default_branch', etc. 'github.repository.private' doesn't work because 'github.repository' is just a string with the owner/repo name, not an object. 'github.private' doesn't exist. There's no GITHUB_PRIVATE environment variable by default. This pattern is useful for workflows that need to behave differently in public vs private repos — e.g., posting coverage to a public badge service only for public repos.