MCPcopy Create free account
hub / github.com/github/gh-aw / BuildNotFromFork

Function BuildNotFromFork

pkg/workflow/expression_builder.go:338–343  ·  view source on GitHub ↗

BuildNotFromFork creates a condition to check that a pull request is not from a forked repository This prevents the job from running on forked PRs where write permissions are not available Uses repository ID comparison instead of full name for more reliable matching

()

Source from the content-addressed store, hash-verified

336// This prevents the job from running on forked PRs where write permissions are not available
337// Uses repository ID comparison instead of full name for more reliable matching
338func BuildNotFromFork() *ComparisonNode {
339 return BuildEquals(
340 BuildPropertyAccess("github.event.pull_request.head.repo.id"),
341 BuildPropertyAccess("github.repository_id"),
342 )
343}
344
345func BuildSafeOutputType(outputType string) ConditionNode {
346 expressionBuilderLog.Printf("Building safe-output condition for output type: %s", outputType)

Callers 4

TestBuildNotFromForkFunction · 0.85
BuildFromAllowedForksFunction · 0.85

Calls 2

BuildEqualsFunction · 0.85
BuildPropertyAccessFunction · 0.85

Tested by 2

TestBuildNotFromForkFunction · 0.68