diff --git a/pkg/constants/constants.go b/pkg/constants/constants.go index 8135895a1f9..7e3986e5eff 100644 --- a/pkg/constants/constants.go +++ b/pkg/constants/constants.go @@ -549,6 +549,7 @@ var AllowedExpressions = []string{ "github.event.pull_request.head.sha", "github.event.pull_request.base.sha", "github.actor", + "github.event_name", "github.job", "github.owner", "github.repository", diff --git a/pkg/workflow/expression_safety_test.go b/pkg/workflow/expression_safety_test.go index 83f7ed18dc7..c3a836f82fc 100644 --- a/pkg/workflow/expression_safety_test.go +++ b/pkg/workflow/expression_safety_test.go @@ -100,6 +100,11 @@ func TestValidateExpressionSafety(t *testing.T) { content: "Default branch: ${{ github.event.repository.default_branch }}", expectError: false, }, + { + name: "allowed_github_event_name", + content: "Event: ${{ github.event_name }}", + expectError: false, + }, { name: "multiple_allowed_expressions", content: "Workflow: ${{ github.workflow }}, Repository: ${{ github.repository }}, Output: ${{ steps.sanitized.outputs.text }}",