Skip to content

Commit 5a2c7f9

Browse files
authored
refactor(dsl): do not use generate action binding for actions/checkout (#1423)
1 parent 088fd3d commit 5a2c7f9

File tree

1 file changed

+13
-2
lines changed
  • github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml

1 file changed

+13
-2
lines changed

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/yaml/ToYaml.kt

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package io.github.typesafegithub.workflows.yaml
22

3-
import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
43
import io.github.typesafegithub.workflows.domain.Job
54
import io.github.typesafegithub.workflows.domain.KotlinLogicStep
65
import io.github.typesafegithub.workflows.domain.Mode
76
import io.github.typesafegithub.workflows.domain.Permission
87
import io.github.typesafegithub.workflows.domain.RunnerType.UbuntuLatest
98
import io.github.typesafegithub.workflows.domain.Workflow
9+
import io.github.typesafegithub.workflows.domain.actions.CustomAction
1010
import io.github.typesafegithub.workflows.domain.contexts.Contexts
1111
import io.github.typesafegithub.workflows.domain.contexts.GithubContext
1212
import io.github.typesafegithub.workflows.dsl.toBuilder
@@ -160,7 +160,18 @@ private fun Workflow.generateYaml(
160160
condition = yamlConsistencyJobCondition,
161161
env = yamlConsistencyJobEnv,
162162
) {
163-
uses(name = "Check out", action = CheckoutV4())
163+
uses(
164+
name = "Check out",
165+
// Since this action is used in a simple way, and we actually don't want to update the version
166+
// because it causes YAML regeneration, let's not use the type-safe binding here. It will also
167+
// let us avoid depending on a Maven-based action binding once bundled bindings are deprecated.
168+
action =
169+
CustomAction(
170+
actionOwner = "actions",
171+
actionName = "checkout",
172+
actionVersion = "v4",
173+
),
174+
)
164175

165176
yamlConsistencyJobAdditionalSteps?.also { block ->
166177
block()

0 commit comments

Comments
 (0)