Repository: CircleCI-Public/circleci-cli

Issue:
config validate does not recognize `pipeline.event.name` pipeline value
## Meta:

**CircleCI CLI Version:**
<!---
  You can run `circleci version` locally in your terminal to return your CLI version.
-->

```
0.1.31425+ebcbd1f (release)
```

**Operating System:**
<!---
  Provide your OS platform.
-->

Arch Linux, under WSL2

**CircleCI CLI Diagnostic:**
<!---
  You can run `circleci diagnostic` locally in your terminal to return your diagnostic information.
-->
```
---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /home/hollis.wu/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
Error: please set a token with 'circleci setup'
You can create a new personal API token here:
https://circleci.com/account/api
```

---

## Current behavior:
<!---
  please include any relevant links to CircleCI workflows or jobs
  where you saw this behavior
-->

```yml
version: 2.1

commands:
  run-me:
    steps:
      - my-step:
          command: |
            echo 1

workflows:
  build-1:
    when: |
      pipeline.event.name == "pull_request"
    jobs:
      - run-me
```

Run `circleci config validate`, here is the reported error

```
Error: config compilation contains errors: config compilation contains errors:
        - Error calling workflow: 'build-1'
        - Error evaluating workflow filter expression:
        - Referred to a variable "pipeline.event.name" that does not exist:
        - pipeline.event.name == "pull_request"
        - ^^^^^^^^^^^^^^^^^^^
```

## Expected behavior:
<!--- what should happen, ideally? -->

The config should pass validation

## When did this begin / Was this previously working?:
<!--- How long as this been happening? -->

IDK just started to use `pipeline.event.name` pipeline variable

## Additional Information:
<!--- Provide any additional context possible. -->

This variable is documented in https://circleci.com/docs/github-trigger-event-options/#supported-trigger-options, but not in [pipeline value table](https://circleci.com/docs/variables/#pipeline-values).

CircleCI dashboard didn't error out this variable.

Discussion:
@barth12: We are experiencing exactly the same issue trying to use new CircleCI GH PR triggers.@elliotforbes: Just a heads up to folks seeing this issue - we've just recently introduced these new pipeline values to help provide more context around what events triggered said pipelines. This is going to be increasingly important as we start to open up to more and more event types from not on GitHub but from other integration points.

My team has created a ticket to address ensuring the CLI is able to operate with these new values and we'll be picking this work up as soon as possible. @elliotforbes: Howdy folks, this should now be live in production. You can get the latest version of the CLI through `brew upgrade circleci`. 

I'm going to close this issue for now, but if you experience any further issues then feel free to re-open!

Solution patch:
diff --git a/config/pipeline.go b/config/pipeline.go
index 66c86e3..dcdf4be 100644
--- a/config/pipeline.go
+++ b/config/pipeline.go
@@ -34,6 +34,7 @@ func LocalPipelineValues(parameters Parameters) Values {
 	vals := map[string]interface{}{
 		"pipeline.id":                                                "00000000-0000-0000-0000-000000000001",
 		"pipeline.number":                                            1,
+		"pipeline.name":                                              "",
 		"pipeline.project.git_url":                                   gitUrl,
 		"pipeline.project.type":                                      projectType,
 		"pipeline.git.tag":                                           git.Tag(),
@@ -41,6 +42,18 @@ func LocalPipelineValues(parameters Parameters) Values {
 		"pipeline.git.revision":                                      revision,
 		"pipeline.git.base_revision":                                 revision,
 		"pipeline.git.branch.is_default":                             false,
+		"pipeline.git.commit.author_avatar_url":                      "",
+		"pipeline.git.commit.author_email":                           "",
+		"pipeline.git.commit.author_login":                           "",
+		"pipeline.git.commit.author_name":                            "",
+		"pipeline.git.commit.body":                                   "",
+		"pipeline.git.commit.subject":                                "",
+		"pipeline.git.commit.url":                                    "",
+		"pipeline.git.repo_id":                                       "",
+		"pipeline.git.repo_name":                                     "",
+		"pipeline.git.repo_owner":                                    "",
+		"pipeline.git.repo_url":                                      gitUrl,
+		"pipeline.git.ssh_checkout_url":                              "",
 		"pipeline.trigger_parameters.circleci.event_time":            "2020-01-01T00:00:00Z",
 		"pipeline.trigger_parameters.webhook.body":                   "",
 		"pipeline.trigger_parameters.github_app.branch":              "main",
@@ -63,6 +76,11 @@ func LocalPipelineValues(parameters Parameters) Values {
 		"pipeline.trigger_parameters.gitlab.default_branch":          "main",
 		"pipeline.trigger_parameters.gitlab.x_gitlab_event_id":       "00000000-0000-0000-0000-000000000001",
 		"pipeline.trigger_parameters.gitlab.is_fork_merge_request":   false,
+		"pipeline.trigger.type":                                      "",
+		"pipeline.trigger.id":                                        "00000000-0000-0000-0000-000000000001",
+		"pipeline.trigger.name":                                      "",
+		"pipeline.event.name":                                        "",
+		"pipeline.event.action":                                      "",
 	}
 
 	for k, v := range parameters {



Test patch:
diff --git a/config/pipeline_test.go b/config/pipeline_test.go
index 213897a..6bdbbd9 100644
--- a/config/pipeline_test.go
+++ b/config/pipeline_test.go
@@ -19,6 +19,7 @@ func TestLocalPipelineValues(t *testing.T) {
 			wantKeys: []string{
 				"pipeline.id",
 				"pipeline.number",
+				"pipeline.name",
 				"pipeline.project.git_url",
 				"pipeline.project.type",
 				"pipeline.git.tag",
@@ -26,6 +27,18 @@ func TestLocalPipelineValues(t *testing.T) {
 				"pipeline.git.revision",
 				"pipeline.git.base_revision",
 				"pipeline.git.branch.is_default",
+				"pipeline.git.commit.author_avatar_url",
+				"pipeline.git.commit.author_email",
+				"pipeline.git.commit.author_login",
+				"pipeline.git.commit.author_name",
+				"pipeline.git.commit.body",
+				"pipeline.git.commit.subject",
+				"pipeline.git.commit.url",
+				"pipeline.git.repo_id",
+				"pipeline.git.repo_name",
+				"pipeline.git.repo_owner",
+				"pipeline.git.repo_url",
+				"pipeline.git.ssh_checkout_url",
 				"pipeline.trigger_parameters.circleci.event_time",
 				"pipeline.trigger_parameters.webhook.body",
 				"pipeline.trigger_parameters.github_app.branch",
@@ -48,6 +61,11 @@ func TestLocalPipelineValues(t *testing.T) {
 				"pipeline.trigger_parameters.gitlab.default_branch",
 				"pipeline.trigger_parameters.gitlab.x_gitlab_event_id",
 				"pipeline.trigger_parameters.gitlab.is_fork_merge_request",
+				"pipeline.trigger.type",
+				"pipeline.trigger.id",
+				"pipeline.trigger.name",
+				"pipeline.event.name",
+				"pipeline.event.action",
 			},
 		},
 		{
@@ -56,6 +74,7 @@ func TestLocalPipelineValues(t *testing.T) {
 			wantKeys: []string{
 				"pipeline.id",
 				"pipeline.number",
+				"pipeline.name",
 				"pipeline.project.git_url",
 				"pipeline.project.type",
 				"pipeline.git.tag",
@@ -65,6 +84,18 @@ func TestLocalPipelineValues(t *testing.T) {
 				"pipeline.parameters.foo",
 				"pipeline.parameters.baz",
 				"pipeline.git.branch.is_default",
+				"pipeline.git.commit.author_avatar_url",
+				"pipeline.git.commit.author_email",
+				"pipeline.git.commit.author_login",
+				"pipeline.git.commit.author_name",
+				"pipeline.git.commit.body",
+				"pipeline.git.commit.subject",
+				"pipeline.git.commit.url",
+				"pipeline.git.repo_id",
+				"pipeline.git.repo_name",
+				"pipeline.git.repo_owner",
+				"pipeline.git.repo_url",
+				"pipeline.git.ssh_checkout_url",
 				"pipeline.trigger_parameters.circleci.event_time",
 				"pipeline.trigger_parameters.webhook.body",
 				"pipeline.trigger_parameters.github_app.branch",
@@ -87,6 +118,11 @@ func TestLocalPipelineValues(t *testing.T) {
 				"pipeline.trigger_parameters.gitlab.default_branch",
 				"pipeline.trigger_parameters.gitlab.x_gitlab_event_id",
 				"pipeline.trigger_parameters.gitlab.is_fork_merge_request",
+				"pipeline.trigger.type",
+				"pipeline.trigger.id",
+				"pipeline.trigger.name",
+				"pipeline.event.name",
+				"pipeline.event.action",
 			},
 		},
 	}