Skip to content

Commit c143a3a

Browse files
committed
ci: fix tip triggers with proper quoting
Change-Id: Idd7a4e784f077ea0084d0387154bb5436f143bc7 Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9623 Reviewed-by: CUE cueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]>
1 parent 746e02e commit c143a3a

File tree

6 files changed

+69
-69
lines changed

6 files changed

+69
-69
lines changed

.github/workflows/new_version_triggers.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
shell: bash
1414
steps:
1515
- name: Rebuild tip.cuelang.org
16-
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
17-
}} --request POST --data-binary "{"event_type": "Re-test post release of ${GITHUB_REF##refs/tags/}"}"
18-
https://api.github.com/repos/cuelang/cuelang.org/dispatches'
16+
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
17+
}} --request POST --data-binary "{\"event_type\": \"Re-test post release of
18+
${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches'
1919
- name: Trigger unity build
20-
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
21-
}} --request POST --data-binary "{"event_type": "Check against CUE ${GITHUB_REF##refs/tags/}",
22-
"client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}\"}}}"
20+
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
21+
}} --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\",
22+
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}"
2323
https://api.github.com/repos/cue-sh/unity/dispatches'

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
2020
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
2121
name: Update Gerrit CL message with starting message
22-
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
22+
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
2323
the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
2424
github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
2525
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
@@ -82,7 +82,7 @@ jobs:
8282
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v
8383
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}
8484
name: Post any failures for this matrix entry
85-
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
85+
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
8686
failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url
8787
}}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}''
8888
-b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
@@ -98,7 +98,7 @@ jobs:
9898
- name: Write the gitcookies file
9999
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
100100
- name: Update Gerrit CL message with success message
101-
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
101+
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
102102
succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id
103103
}}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
104104
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'

.github/workflows/tip_triggers.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ jobs:
1313
shell: bash
1414
steps:
1515
- name: Rebuild tip.cuelang.org
16-
run: curl -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
16+
run: curl -f -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
1717
}}
1818
- name: Trigger unity build
19-
run: 'echo curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
20-
}} --request POST --data-binary "{"event_type": "Check against ${GITHUB_SHA}",
21-
"client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA}\""}}}"
19+
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
20+
}} --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\",
21+
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}"
2222
https://api.github.com/repos/cue-sh/unity/dispatches'

cmd/cue/cmd/testdata/script/cmd_github.txt

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,13 @@ jobs:
6666
shell: bash
6767
steps:
6868
- name: Rebuild tip.cuelang.org
69-
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
70-
}} --request POST --data-binary "{"event_type": "Re-test post release of ${GITHUB_REF##refs/tags/}"}"
71-
https://api.github.com/repos/cuelang/cuelang.org/dispatches'
69+
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
70+
}} --request POST --data-binary "{\"event_type\": \"Re-test post release of
71+
${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches'
7272
- name: Trigger unity build
73-
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
74-
}} --request POST --data-binary "{"event_type": "Check against CUE ${GITHUB_REF##refs/tags/}",
75-
"client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}\"}}}"
73+
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
74+
}} --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\",
75+
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}"
7676
https://api.github.com/repos/cue-sh/unity/dispatches'
7777
-- .github/workflows/release.yml.golden --
7878
# Generated by internal/ci/ci_tool.cue; do not edit
@@ -231,7 +231,7 @@ jobs:
231231
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
232232
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
233233
name: Update Gerrit CL message with starting message
234-
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
234+
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
235235
the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
236236
github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
237237
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
@@ -294,7 +294,7 @@ jobs:
294294
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v
295295
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}
296296
name: Post any failures for this matrix entry
297-
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
297+
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
298298
failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url
299299
}}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}''
300300
-b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
@@ -310,7 +310,7 @@ jobs:
310310
- name: Write the gitcookies file
311311
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
312312
- name: Update Gerrit CL message with success message
313-
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
313+
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
314314
succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id
315315
}}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
316316
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
@@ -346,12 +346,12 @@ jobs:
346346
shell: bash
347347
steps:
348348
- name: Rebuild tip.cuelang.org
349-
run: curl -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
349+
run: curl -f -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
350350
}}
351351
- name: Trigger unity build
352-
run: 'echo curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
353-
}} --request POST --data-binary "{"event_type": "Check against ${GITHUB_SHA}",
354-
"client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA}\""}}}"
352+
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
353+
}} --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\",
354+
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}"
355355
https://api.github.com/repos/cue-sh/unity/dispatches'
356356
-- internal/ci/ci_tool.cue --
357357
// Copyright 2021 The CUE Authors
@@ -1414,7 +1414,7 @@ tip_triggers: _#bashWorkflow & {
14141414
run: "\(_#curl) -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook }}"
14151415
}, {
14161416
name: "Trigger unity build"
1417-
run: "echo \(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.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"
1417+
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.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"
14181418
}]
14191419
}
14201420
}
@@ -1425,10 +1425,10 @@ new_version_triggers: _#bashWorkflow & {
14251425
"runs-on": _#linuxMachine
14261426
steps: [{
14271427
name: "Rebuild tip.cuelang.org"
1428-
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\"event_type\": \"Re-test post release of ${GITHUB_REF##refs/tags/}\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches"
1428+
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches"
14291429
}, {
14301430
name: "Trigger unity build"
1431-
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.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"
1431+
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.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"
14321432
}]
14331433
}
14341434
}
@@ -1559,4 +1559,4 @@ _#copybaraSteps: {
15591559
_#name: string
15601560
_#cmd: string
15611561
}
1562-
_#curl: "curl -s"
1562+
_#curl: "curl -f -s"

0 commit comments

Comments
 (0)