Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Kotlin-based steps don't work if there's more than one workflow in Kotlin script #1811

Open
1 of 3 tasks
krzema12 opened this issue Feb 4, 2025 · 0 comments
Open
1 of 3 tasks
Labels
bug Something isn't working

Comments

@krzema12
Copy link
Member

krzema12 commented Feb 4, 2025

Component

Action

Create a script with more than one workflow, emitting more than one YAML, to easily share code, and have a Kotlin-based logic step, e.g.:

workflow(
    name = "Foo",
    // ...
) {
    job(...) {
        run {
            println("Hello!")
        }
    }
}

workflow(
    name = "Bar",
    // ...
) { ... }

Expected

The correct piece of logic is called.

Actual

Run GHWKT_RUN_STEP='release:step-9' '.github/workflows/release.main.kts'
java.util.NoSuchElementException: Collection contains no element matching the predicate.
	at io.github.typesafegithub.workflows.yaml.ToYamlKt.writeToFile(ToYaml.kt:173)
	at io.github.typesafegithub.workflows.dsl.WorkflowBuilderKt.workflow(WorkflowBuilder.kt:231)
	at io.github.typesafegithub.workflows.dsl.WorkflowBuilderKt.workflow$default(WorkflowBuilder.kt:176)
	at Release_main.<init>(release.main.kts:96)

https://github.com/typesafegithub/github-actions-typing/actions/runs/13130825653/job/36635476372

Likely because in the workflow that has a job called release, all works fine, but the other workflow doesn't have such a job. If it had it, it would call more than one step.

Likely fails in

Workaround, if exists

Unknown yet.

Version

3.2.0, but likely all that have the experimental Kotlin-based step are affected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant