Skip to content

Commit

Permalink
internal/ci: drop parameter from trybotDispatchWorkflow
Browse files Browse the repository at this point in the history
The name already indicates it is not reusable in any way. If at a later
date we need to make it generic and parameterised we can. For now it's
just noise.

Signed-off-by: Paul Jolly <paul@myitcv.io>
Change-Id: Ib644dee24e6b1a315b56c716028af7cbc0c06eba
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue/+/551801
Unity-Result: CUEcueckoo <cueckoo@cuelang.org>
TryBot-Result: CUEcueckoo <cueckoo@cuelang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
  • Loading branch information
myitcv committed Mar 28, 2023
1 parent cb9d6ed commit 6318def
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 5 additions & 6 deletions internal/ci/base/gerrithub.cue
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ import (
)

trybotDispatchWorkflow: json.#Workflow & {
#type: string
_#branchNameExpression: "\(#type)/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}/${{ steps.gerrithub_ref.outputs.gerrithub_ref }}"
name: "Dispatch \(#type)"
_#branchNameExpression: "\(trybot.key)/${{ github.event.client_payload.payload.changeID }}/${{ github.event.client_payload.payload.commit }}/${{ steps.gerrithub_ref.outputs.gerrithub_ref }}"
name: "Dispatch \(trybot.key)"
on: ["repository_dispatch"]
jobs: [string]: defaults: run: shell: "bash"
jobs: {
(#type): {
(trybot.key): {
"runs-on": linuxMachine
if: "${{ github.event.client_payload.type == '\(#type)' }}"
if: "${{ github.event.client_payload.type == '\(trybot.key)' }}"
steps: [
writeNetrcFile,
// Out of the entire ref (e.g. refs/changes/38/547738/7) we only
Expand All @@ -29,7 +28,7 @@ trybotDispatchWorkflow: json.#Workflow & {
"""#
},
json.#step & {
name: "Trigger \(#type)"
name: "Trigger \(trybot.key)"
run: """
mkdir tmpgit
cd tmpgit
Expand Down
4 changes: 1 addition & 3 deletions internal/ci/github/trybot_dispatch.cue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,4 @@ import (
)

// The trybot_dispatch workflow.
workflows: trybot_dispatch: repo.bashWorkflow & repo.trybotDispatchWorkflow & {
#type: repo.trybot.key
}
workflows: trybot_dispatch: repo.bashWorkflow & repo.trybotDispatchWorkflow

0 comments on commit 6318def

Please sign in to comment.