Skip to content

Commit

Permalink
More tests
Browse files Browse the repository at this point in the history
  • Loading branch information
krzema12 committed Apr 22, 2024
1 parent ababc8a commit a7605d5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/test-workflow.main.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env kotlin
@file:Repository("https://s01.oss.sonatype.org/content/repositories/snapshots/")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.14.1-20240422.092635-34")
@file:DependsOn("io.github.typesafegithub:github-workflows-kt:1.14.1-20240422.100111-37")
@file:OptIn(ExperimentalKotlinLogicStep::class)

import io.github.typesafegithub.workflows.actions.actions.CheckoutV4
Expand All @@ -21,8 +21,15 @@ workflow(
runsOn = RunnerType.UbuntuLatest,
) {
uses(action = CheckoutV4())
run(name = "Step with Kotlin logic") {
run(name = "Step with Kotlin logic") { github ->
println("Hello from Kotlin!")
println("github.sha: ${github.sha}")
println(
"Can do any sort of transformations: ${github.repository
.filter { it !in setOf('a', 'e', 'i', 'o', 'u', 'y') }
.uppercase()}",
)
println("Can access nested values: ${github.event.after}")
}
}
}.writeToFile()
4 changes: 1 addition & 3 deletions .github/workflows/test-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,4 @@ jobs:
name: 'Step with Kotlin logic'
env:
GHWKT_GITHUB_CONTEXT_JSON: '${{ toJSON(github) }}'
run: |-
echo $GHWKT_GITHUB_CONTEXT_JSON > github-context.json
GHWKT_RUN_STEP='test-job:step-1' '.github/workflows/test-workflow.main.kts'
run: 'GHWKT_RUN_STEP=''test-job:step-1'' ''.github/workflows/test-workflow.main.kts'''

0 comments on commit a7605d5

Please sign in to comment.