Write a GitHub Action in Pkl 🚀 #263
Replies: 2 comments 7 replies
-
Hey, awesome!
Yup!
You can certainly do this. It means that your consumers then need to re-import
I'd actually recommend defining
Some other comments:
|
Beta Was this translation helpful? Give feedback.
-
This is cool and maybe we can work together! I'd also started working on Pkl for GitHub Actions before I came across this discussion. Usage in my Effect Oriented Programming book: Usage to release pklgha: Still a lot to do but it has been fun to have actual reuseability and abstractions. :) |
Beta Was this translation helpful? Give feedback.
-
Update to my original post below 👇
The GitHub Action template is available at
👉 https://github.com/StefMa/pkl-gha/
and ready to use in version 0.0.1
Simply
amend
the templateand fill out the require properties
name
,on
andjobs
.Running the following command will produce your Action workflow in yaml format:
More examples can be found there
👉 https://github.com/StefMa/pkl-gha/tree/d266b8b2f9a541774b2f648a1c583d057c931462/examples
If you miss something don't hesitate to create an issue, hit me up here or create a PR to add it ❤️
Original post:
Hello together,
I have been playing around a bit with Pkl the last few days and thought I create a GitHub Action package as an example.
Similar to the already available
com.circleci
package.The following shows how a Workflow in Pkl can be look like:
The (yml) output of this can be found here
The source code can be found here
👉 com.github.action@0.0.1.zip
(Because I'm not sure if this is good enough to be published on my GitHub Account I didn't do so yet 😁 )
What do you think? 🙃
Its obviously not ready for production and early early alpha.
I might even change the package module in the future 🙃
I just did this for testing Pkl.
My questions are:
amend
theWorkflow.pkl
file in my "consumer"? (I did this because of the templating description (docs))import
theGitHubAction.pkl
file in my "consumer? (I did this because I wanna distrinight between the template and the "building blocks" of a Workflow)on
statement somehow? I introducedonRaw
andonListing
because I thinkonListing
looks way better than theonRaw
with themapping
and you know the names of each "on" trigger. I wanted to hide this. However, usingonListing
instead of juston
looks also not soo good. So my question is: Can I somehow defineon
as a List, but map it to aMapping
for the output later? If so, how?Beta Was this translation helpful? Give feedback.
All reactions