Skip to content

Commit 76c49fb

Browse files
authored
test: make single-role assertion specific in role checks (#26804)
1 parent f916d5d commit 76c49fb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/workflow/role_checks_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ Test that on.roles supports a single string permission value.`
182182

183183
compiledStr := string(compiledContent)
184184
assert.Contains(t, compiledStr, "id: check_membership", "Compiled workflow should include membership checks for role-gated triggers")
185-
assert.Contains(t, compiledStr, "write", "Compiled workflow should require the single role provided as a string")
185+
assert.Contains(t, compiledStr, `GH_AW_REQUIRED_ROLES: "write"`, "Compiled workflow should require the single role provided as a string")
186+
assert.NotContains(t, compiledStr, `GH_AW_REQUIRED_ROLES: "admin,maintainer,write"`, "Compiled workflow should not fall back to default role list when a single role string is provided")
186187
}
187188

188189
func TestInferEventsFromTriggers(t *testing.T) {

0 commit comments

Comments
 (0)