StefMa / pkl-gha

A Pkl (https://pkl-lang.org/) template for writing GitHub Action workflows
MIT License
7 stars 0 forks source link

Support reusable workflow jobs #10

Open StefMa opened 3 weeks ago

StefMa commented 3 weeks ago

See https://docs.github.com/en/actions/sharing-automations/reusing-workflows#calling-a-reusable-workflow and reusableWorkflowCallJob in https://json.schemastore.org/github-workflow.json and https://github.com/realm/realm-dotnet/pull/3603/files#diff-f3b41c2a32e0d2f721a847123abdf488ac28d05a61deb9daae1aeb9aeb950584R586-R590

The config could look like:

jobs: Mapping<String, *NormalJob|ReusableWorkflowJob>(jobIsSet)

IIRC then the NormalJob will be preferred and can be used with simply new { }, but you can use the ReusableWorkflowJob by saying new ReusableWorkflowJob {}.