I thought a bit about auto-updating the actions within the com.github.actions package.
The solution is quite obvious:
- Create a github action workflow
- run it every [to be discussed]
- create a PR with the updated actions.
The second part is a bit tricky.
What exactly should we run?
There is the script/generate-github.sh which kind of already does the job.
But this has a problem.
If a latest version was found, but it is not part of the typesafegithub catalog, it just create the action without typing aka. fallsback to String|Number|Boolean (= not good enough for us 😅 ).
We have a workaround for this, by creating our the actionTypes ourselfs and place it into scripts/actionTypes/actions.
But
- This is in my opinion not a good solution because we end up with two sources. One the internal
actionTypes/actions and typesafegithub.
- This needs manual efford, which is simply not doable on CI.
typesafegithub solves this a bit.
I found out that they fallback to the previous version if the current version was not found.
E.g.
actions/checkout@v6 requested but not found
actions/checkout@v5 typings returned
So what we can do:
- Remove the pkl workaround
- Rely 100% on the
typesafegithub catalog
- Fallback to the previous version if not yet typed
With this, the package will always have up-to-date actions.
Even if v[newRelease] is not 100% typed, most of it is.
Given that inputs and outputs changes very rarely.
However, we still have the inputs available with our fallback of String|Number|Boolean.
The next question would arrise:
How to update this action, as soon as it got typed?
Just random thoughts about this topic.
Would be great to get your opinions on that 🙂
Have a nice christmas in case you celebrate it 🎄
Otherwise just enjoy the time 🙂
I thought a bit about auto-updating the actions within the
com.github.actionspackage.The solution is quite obvious:
The second part is a bit tricky.
What exactly should we run?
There is the
script/generate-github.shwhich kind of already does the job.But this has a problem.
If a latest version was found, but it is not part of the
typesafegithubcatalog, it just create the action without typing aka. fallsback toString|Number|Boolean(= not good enough for us 😅 ).We have a workaround for this, by creating our the
actionTypesourselfs and place it intoscripts/actionTypes/actions.But
actionTypes/actionsandtypesafegithub.typesafegithubsolves this a bit.I found out that they fallback to the previous version if the current version was not found.
E.g.
actions/checkout@v6requested but not foundactions/checkout@v5typings returnedSo what we can do:
typesafegithubcatalogWith this, the package will always have up-to-date actions.
Even if
v[newRelease]is not 100% typed, most of it is.Given that inputs and outputs changes very rarely.
However, we still have the inputs available with our fallback of
String|Number|Boolean.The next question would arrise:
How to update this action, as soon as it got typed?
Just random thoughts about this topic.
Would be great to get your opinions on that 🙂
Have a nice christmas in case you celebrate it 🎄
Otherwise just enjoy the time 🙂