[Core feature request] Add support to Workflow Dispatch Inputs

Aperta
#811 5 commenti 3 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
github-actions, kotlin
Ambito
ci-cd, devops

Direzione di ricerca

Start with GitHub's workflow_dispatch inputs syntax and the existing WorkflowDispatch/Input usage shown in the issue. Trace how workflow triggers and environment expressions are modeled, then compare generated output with the linked kotest example. Done means callers can declare and reference dispatch inputs without the event.inputs workaround.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement

Discussed in Kotlin's Slack: https://app.slack.com/client/T09229ZC6/C02UUATR7RC/thread/C02UUATR7RC-1682902161.628869

What feature do you need?
Workflows Dispatch Inputs:
https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#onworkflow_dispatchinputs

Do you have an example usage?

https://github.com/kotest/kotest/blob/80bc809be1e0452dc1f3ee2e67aec2f6c7f6c251/.github/workflows/release_base.yml#L15


env:
   RELEASE_VERSION: ${{ inputs.version }}
   OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
   OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
   ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
   ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
   GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxMetaspaceSize=756m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

Is there a workaround for not having this feature? If yes, please describe it.

Yes. One can use WorkflowDispatch normally, and use expr { github["event.inputs.XXXX"]!! } to get the value when they need it.

workflow(
  name = "Publish",
  on = listOf(
    WorkflowDispatch(
      mapOf("RELEASE_VERSION" to Input("The release version", true, String))
    )
  ),
  sourceFile = __FILE__.toPath(),
  env = linkedMapOf(
    "OSSRH_USERNAME" to expr { OSSRH_USERNAME },
    "OSSRH_PASSWORD" to expr { OSSRH_PASSWORD },
    "ORG_GRADLE_PROJECT_signingKey" to expr { ORG_GRADLE_PROJECT_signingKey },
    "ORG_GRADLE_PROJECT_signingPassword" to expr { ORG_GRADLE_PROJECT_signingPassword },
    "RELEASE_VERSION" to expr { github["event.inputs.version"]!! }
  )
)
Lingua principale
Kotlin
Stelle
664
Fork
30
Merge medio
4g 19h
PR unite (30g)
5

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di typesafegithub/github-workflows-kt

Tutte le issue di typesafegithub/github-workflows-kt

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.