ci: fix broken tip and new version triggers

For some reason, the local testing of these gave a false positive pass.
Hopefully this time we've got the shell script right.

Change-Id: I1d3c65f48ca7c8275eddebc1e7340b6e5fe40ef5
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9581
Reviewed-by: CUE cueckoo <cueckoo@gmail.com>
Reviewed-by: Paul Jolly <paul@myitcv.org.uk>
diff --git a/.github/workflows/new_version_triggers.yml b/.github/workflows/new_version_triggers.yml
index a745e14..330953f 100644
--- a/.github/workflows/new_version_triggers.yml
+++ b/.github/workflows/new_version_triggers.yml
@@ -19,5 +19,5 @@
     - name: Trigger unity build
       run: 'curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT
         --request POST --data-binary "{"event_type": "Check against CUE ${GITHUB_REF##refs/tags/}",
-        "client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}}})\""}}}"
+        "client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}\"}}}"
         https://api.github.com/repos/cue-sh/unity/dispatches'
diff --git a/.github/workflows/tip_triggers.yml b/.github/workflows/tip_triggers.yml
index 994975a..5ad0696 100644
--- a/.github/workflows/tip_triggers.yml
+++ b/.github/workflows/tip_triggers.yml
@@ -18,5 +18,5 @@
     - name: Trigger unity build
       run: 'curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT
         --request POST --data-binary "{"event_type": "Check against ${GITHUB_SHA}",
-        "client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA})\""}}}"
+        "client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA}\""}}}"
         https://api.github.com/repos/cue-sh/unity/dispatches'
diff --git a/cmd/cue/cmd/testdata/script/cmd_github.txt b/cmd/cue/cmd/testdata/script/cmd_github.txt
index aedf063..25d1987 100644
--- a/cmd/cue/cmd/testdata/script/cmd_github.txt
+++ b/cmd/cue/cmd/testdata/script/cmd_github.txt
@@ -72,7 +72,7 @@
     - name: Trigger unity build
       run: 'curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT
         --request POST --data-binary "{"event_type": "Check against CUE ${GITHUB_REF##refs/tags/}",
-        "client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}}})\""}}}"
+        "client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}\"}}}"
         https://api.github.com/repos/cue-sh/unity/dispatches'
 -- .github/workflows/release.yml.golden --
 # Generated by internal/ci/ci_tool.cue; do not edit
@@ -351,7 +351,7 @@
     - name: Trigger unity build
       run: 'curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT
         --request POST --data-binary "{"event_type": "Check against ${GITHUB_SHA}",
-        "client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA})\""}}}"
+        "client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA}\""}}}"
         https://api.github.com/repos/cue-sh/unity/dispatches'
 -- internal/ci/ci_tool.cue --
 // Copyright 2021 The CUE Authors
@@ -1415,7 +1415,7 @@
 		}, {
 			name: "Trigger unity build"
 			run: """
-				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA})\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
+				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
 				"""
 		}]
 	}
@@ -1433,7 +1433,7 @@
 		}, {
 			name: "Trigger unity build"
 			run: """
-				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}}})\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
+				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
 				"""
 		}]
 	}
diff --git a/cue/testdata/eval/github.txtar b/cue/testdata/eval/github.txtar
index 13f5faa..6edd9ae 100644
--- a/cue/testdata/eval/github.txtar
+++ b/cue/testdata/eval/github.txtar
@@ -261,7 +261,7 @@
 		}, {
 			name: "Trigger unity build"
 			run: """
-				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA})\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
+				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
 				"""
 		}]
 	}
@@ -279,7 +279,7 @@
 		}, {
 			name: "Trigger unity build"
 			run: """
-				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}}})\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
+				curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
 				"""
 		}]
 	}
@@ -1624,7 +1624,7 @@
               }
               1: (#struct){
                 name: (string){ "Trigger unity build" }
-                run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA})\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
+                run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
               }
             }
             defaults: (#struct){
@@ -1695,7 +1695,7 @@
               }
               1: (#struct){
                 name: (string){ "Trigger unity build" }
-                run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}}})\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
+                run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
               }
             }
             defaults: (#struct){
@@ -2394,7 +2394,7 @@
           }
           1: (#struct){
             name: (string){ "Trigger unity build" }
-            run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA})\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
+            run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
           }
         }
         defaults: (#struct){
@@ -2462,7 +2462,7 @@
           }
           1: (#struct){
             name: (string){ "Trigger unity build" }
-            run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}}})\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
+            run: (string){ "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches" }
           }
         }
         defaults: (#struct){
@@ -2958,7 +2958,7 @@
           },
           {
             name: "Trigger unity build"
-            run: "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA})\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
+            run: "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
           },
         ]
       }
@@ -2983,7 +2983,7 @@
           },
           {
             name: "Trigger unity build"
-            run: "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}}})\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
+            run: "curl -s -H \"Content-Type: application/json\" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
           },
         ]
       }
diff --git a/internal/ci/workflows.cue b/internal/ci/workflows.cue
index 5e6a9aa..0d69791 100644
--- a/internal/ci/workflows.cue
+++ b/internal/ci/workflows.cue
@@ -333,7 +333,7 @@
 			{
 				name: "Trigger unity build"
 				run: """
-					curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA})\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
+					curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
 					"""
 			},
 		]
@@ -356,7 +356,7 @@
 			{
 				name: "Trigger unity build"
 				run: """
-					curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}}})\\\"\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
+					curl -s -H "Content-Type: application/json" -u cueckoo:$CUECKOO_GITHUB_PAT --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}" https://api.github.com/repos/cue-sh/unity/dispatches
 					"""
 			},
 		]