14
14
* limitations under the License.
15
15
*/
16
16
17
- @file:DependsOn(" io.github.typesafegithub:github-workflows-kt:1.14 .0" )
17
+ @file:DependsOn(" io.github.typesafegithub:github-workflows-kt:2.0 .0" )
18
18
19
19
import io.github.typesafegithub.workflows.domain.Concurrency
20
20
import io.github.typesafegithub.workflows.domain.triggers.Trigger
21
21
import io.github.typesafegithub.workflows.dsl.WorkflowBuilder
22
22
import io.github.typesafegithub.workflows.dsl.workflow
23
23
import io.github.typesafegithub.workflows.yaml.Preamble.WithOriginalAfter
24
- import io.github.typesafegithub.workflows.yaml.writeToFile
25
24
import java.io.File
26
25
27
26
fun workflowWithCopyright (
28
27
name : String ,
29
28
on : List <Trigger >,
30
- env : LinkedHashMap <String , String > = linkedMapOf (),
29
+ env : Map <String , String > = mapOf (),
31
30
sourceFile : File ,
32
31
concurrency : Concurrency ? = null,
33
32
block : WorkflowBuilder .() -> Unit
34
33
) {
35
- val sourceFilePath = sourceFile.toPath()
36
34
workflow(
37
35
name = name,
38
36
on = on,
39
37
env = env,
40
- sourceFile = sourceFilePath ,
38
+ sourceFile = sourceFile ,
41
39
concurrency = concurrency,
42
- block = block
43
- ).writeToFile(
44
40
preamble = WithOriginalAfter (
45
41
"""
46
42
Copyright 2020-2023 Björn Kautler
@@ -57,6 +53,7 @@ fun workflowWithCopyright(
57
53
See the License for the specific language governing permissions and
58
54
limitations under the License.
59
55
""" .trimIndent()
60
- )
56
+ ),
57
+ block = block
61
58
)
62
59
}
0 commit comments