this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

internal/ci: trigger Unity on master as porcuepine

By default, repositoryDispatch and curlGitHubAPI use CUECKOO_GITHUB_PAT,
which cannot trigger workflows in the new cue-unity/unity-private.
Use PORCUEPINE_GITHUB_PAT, which can, as the bot account for cue-unity.

Note that repositoryDispatch had bot user and token input definitions,
but they weren't actually used. The user one is entirely unnecessary,
and the token one wasn't threaded properly into curlGitHubAPI.

Those weren't a problem before, because each repo only needed to use
a single bot account's personal access token secret.
With the switch to unity-private, the main CUE repo now needs to use
tokens from two bot accounts for different purposes.

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
Change-Id: Ia6ad0112c3c795ff3ab58c3ccc9ed4c03c2ea32f
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/554262
Unity-New-Result: CUE porcuepine <cue.porcuepine@gmail.com>
TryBot-Result: CUEcueckoo <cueckoo+gerrithub@cuelang.org>
Reviewed-by: Paul Jolly <paul@myitcv.io>

+13 -7
+1 -1
.github/workflows/tip_triggers.yml
··· 16 16 - name: Trigger tip.cuelang.org deploy 17 17 run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --request POST --data-binary "{\"event_type\":\"Rebuild tip against ${GITHUB_SHA}\",\"client_payload\":{\"type\":\"rebuild_tip\"}}" https://api.github.com/repos/cue-lang/cuelang.org/dispatches' 18 18 - name: Trigger unity build 19 - run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.CUECKOO_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --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-unity/unity-private/dispatches' 19 + run: 'curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.PORCUEPINE_GITHUB_PAT }}" -H "X-GitHub-Api-Version: 2022-11-28" -f --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-unity/unity-private/dispatches'
+9 -4
internal/ci/base/github.cue
··· 163 163 """# 164 164 } 165 165 166 - curlGitHubAPI: #""" 167 - curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.\#(botGitHubUserTokenSecretsKey) }}" -H "X-GitHub-Api-Version: 2022-11-28" 166 + curlGitHubAPI: { 167 + #tokenSecretsKey: *botGitHubUserTokenSecretsKey | string 168 + 169 + #""" 170 + curl -s -L -H "Accept: application/vnd.github+json" -H "Authorization: Bearer ${{ secrets.\#(#tokenSecretsKey) }}" -H "X-GitHub-Api-Version: 2022-11-28" 168 171 """# 172 + } 169 173 170 174 setupGoActionsCaches: { 171 175 // #readonly determines whether we ever want to write the cache back. The ··· 296 300 297 301 repositoryDispatch: json.#step & { 298 302 #githubRepositoryPath: *githubRepositoryPath | string 299 - #botGitHubUser: *botGitHubUser | string 300 303 #botGitHubUserTokenSecretsKey: *botGitHubUserTokenSecretsKey | string 301 304 #arg: _ 305 + 306 + _curlGitHubAPI: curlGitHubAPI & {#tokenSecretsKey: #botGitHubUserTokenSecretsKey, _} 302 307 303 308 name: string 304 309 run: #""" 305 - \#(curlGitHubAPI) -f --request POST --data-binary \#(strconv.Quote(encjson.Marshal(#arg))) https://api.github.com/repos/\#(#githubRepositoryPath)/dispatches 310 + \#(_curlGitHubAPI) -f --request POST --data-binary \#(strconv.Quote(encjson.Marshal(#arg))) https://api.github.com/repos/\#(#githubRepositoryPath)/dispatches 306 311 """# 307 312 } 308 313
+3 -2
internal/ci/github/tip_triggers.cue
··· 35 35 } 36 36 }, 37 37 _repo.repositoryDispatch & { 38 - name: "Trigger unity build" 39 - #githubRepositoryPath: _repo.unityRepositoryPath 38 + name: "Trigger unity build" 39 + #githubRepositoryPath: _repo.unityRepositoryPath 40 + #botGitHubUserTokenSecretsKey: "PORCUEPINE_GITHUB_PAT" 40 41 #arg: { 41 42 event_type: "Check against ${GITHUB_SHA}" 42 43 client_payload: {