Skip to content

Commit 5100525

Browse files
committed
internal/ci: skip "check git tags" when testing CLs
This step is only important so that we notice if any git tags vanish from either GitHub or Gerrit. Its value comes mainly from running regularly, i.e. on pushes to master and the nightly runs. It doesn't have to run when testing every incoming CL or PR, because those don't affect the presence of any tags. This step is fast, but it still takes 2-5s on the slowest matrix job. Signed-off-by: Daniel Martí <[email protected]> Change-Id: I15bd92a354cec05fe025a6ea9b83fc4fc4facc96 Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/1217961 TryBot-Result: CUEcueckoo <[email protected]> Reviewed-by: Paul Jolly <[email protected]> Unity-Result: CUE porcuepine <[email protected]>
1 parent 6f50798 commit 5100525

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.github/workflows/trybot.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ jobs:
151151
version: "2025.1"
152152
install-go: false
153153
use-cache: false
154-
- if: (matrix.go-version == '1.24.x' && matrix.runner == 'ns-ubuntu-amd64')
154+
- if: |-
155+
(((github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-branch.')) && (! (contains(github.event.head_commit.message, '
156+
Dispatch-Trailer: {"type":"')))) || (github.ref == 'refs/heads/ci/test')) && (matrix.go-version == '1.24.x' && matrix.runner == 'ns-ubuntu-amd64')
155157
name: Check all git tags are available
156158
run: |-
157159
cd $(mktemp -d)

internal/ci/github/trybot.cue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,12 +193,12 @@ workflows: trybot: _repo.bashWorkflow & {
193193

194194
_checkTags: githubactions.#Step & {
195195
// Ensure that GitHub and Gerrit agree on the full list of available tags.
196-
// This way, if there is any discrepancy, we will get a useful go-cmp diff.
196+
// This way, if there is any discrepancy, we will get a useful diff.
197197
//
198198
// We use `git ls-remote` to list all tags from each remote git repository
199199
// because it does not depend on custom REST API endpoints and is very fast.
200200
// Note that it sorts tag names as strings, which is not the best, but works OK.
201-
if: _isLatestLinux
201+
if: "(\(_repo.isProtectedBranch) || \(_repo.isTestDefaultBranch)) && \(_isLatestLinux)"
202202
name: "Check all git tags are available"
203203
run: """
204204
cd $(mktemp -d)

0 commit comments

Comments
 (0)