Skip to content

Commit f1f0963

Browse files
committed
internal/ci: remove debug logging of commit message
The original logging could, at very low risk, have introduced a potential security issue, as the logging did not disable shell interpolation of the contents of the commit message. In any case the logging is not required, so remove it. We also remove the now-unused workflowDispatch step template. Signed-off-by: Paul Jolly <[email protected]> Change-Id: I4a3b8cfef28356350a2fb72e19ca7b6661244084 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1196926 Reviewed-by: Roger Peppe <[email protected]> TryBot-Result: CUEcueckoo <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent e9b2c29 commit f1f0963

File tree

4 files changed

+4
-57
lines changed

4 files changed

+4
-57
lines changed

.github/workflows/evict_caches.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,7 @@ jobs:
4444
Dispatch-Trailer: {"type":"'))
4545
name: Check we don't have Dispatch-Trailer on a protected branch
4646
run: |-
47-
echo "github.event.head_commit.message contains Dispatch-Trailer"
48-
echo "github.event.head_commit.message value"
49-
cat <<EOD
50-
${{ github.event.head_commit.message }}
51-
EOD
52-
echo "containsDispatchTrailer expression"
53-
cat <<EOD
54-
(contains(github.event.head_commit.message, '
55-
Dispatch-Trailer: {"type":"'))
56-
EOD
47+
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch"
5748
false
5849
- name: Delete caches
5950
run: |-

.github/workflows/release.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,7 @@ jobs:
5151
Dispatch-Trailer: {"type":"'))
5252
name: Check we don't have Dispatch-Trailer on a protected branch
5353
run: |-
54-
echo "github.event.head_commit.message contains Dispatch-Trailer"
55-
echo "github.event.head_commit.message value"
56-
cat <<EOD
57-
${{ github.event.head_commit.message }}
58-
EOD
59-
echo "containsDispatchTrailer expression"
60-
cat <<EOD
61-
(contains(github.event.head_commit.message, '
62-
Dispatch-Trailer: {"type":"'))
63-
EOD
54+
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch"
6455
false
6556
- name: Install Go
6657
uses: actions/setup-go@v5

.github/workflows/trybot.yml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,7 @@ jobs:
6464
Dispatch-Trailer: {"type":"'))
6565
name: Check we don't have Dispatch-Trailer on a protected branch
6666
run: |-
67-
echo "github.event.head_commit.message contains Dispatch-Trailer"
68-
echo "github.event.head_commit.message value"
69-
cat <<EOD
70-
${{ github.event.head_commit.message }}
71-
EOD
72-
echo "containsDispatchTrailer expression"
73-
cat <<EOD
74-
(contains(github.event.head_commit.message, '
75-
Dispatch-Trailer: {"type":"'))
76-
EOD
67+
echo "github.event.head_commit.message contains Dispatch-Trailer but we are on a protected branch"
7768
false
7869
- name: Install Go
7970
uses: actions/setup-go@v5

internal/ci/base/github.cue

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,7 @@ checkoutCode: {
9191
name: "Check we don't have \(dispatchTrailer) on a protected branch"
9292
if: "\(isProtectedBranch) && \(containsDispatchTrailer)"
9393
run: """
94-
echo "\(_dispatchTrailerVariable) contains \(dispatchTrailer)"
95-
echo "\(_dispatchTrailerVariable) value"
96-
cat <<EOD
97-
${{ \(_dispatchTrailerVariable) }}
98-
EOD
99-
echo "containsDispatchTrailer expression"
100-
cat <<EOD
101-
\(containsDispatchTrailer)
102-
EOD
94+
echo "\(_dispatchTrailerVariable) contains \(dispatchTrailer) but we are on a protected branch"
10395
false
10496
"""
10597
},
@@ -297,24 +289,6 @@ repositoryDispatch: json.#step & {
297289
"""#
298290
}
299291

300-
workflowDispatch: json.#step & {
301-
#githubRepositoryPath: *githubRepositoryPath | string
302-
#botGitHubUserTokenSecretsKey: *botGitHubUserTokenSecretsKey | string
303-
#workflowID: string
304-
305-
// params are defined per https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event
306-
#params: *{
307-
ref: defaultBranch
308-
} | _
309-
310-
_curlGitHubAPI: curlGitHubAPI & {#tokenSecretsKey: #botGitHubUserTokenSecretsKey, _}
311-
312-
name: string
313-
run: #"""
314-
\#(_curlGitHubAPI) --fail --request POST --data-binary \#(strconv.Quote(encjson.Marshal(#params))) https://api.github.com/repos/\#(#githubRepositoryPath)/actions/workflows/\#(#workflowID)/dispatches
315-
"""#
316-
}
317-
318292
// dispatchTrailer is the trailer that we use to pass information in a commit
319293
// when triggering workflow events in other GitHub repos.
320294
//

0 commit comments

Comments
 (0)