✨ Get version from dagger.json
What are you trying to do?
In order to keep the Dagger version used in GitHub Actions the same as the engine version used, it would be nice to be able to supply a path to a dagger.json file and have the engine version parsed from it and used.
This behaviour would be similar to the setup-go action which can get the Go version from a go.mod file: https://github.com/actions/setup-go?tab=readme-ov-file#getting-go-version-from-the-gomod-file.
Example
uses: dagger/dagger-for-github@v5
with:
verb: call
args: something
version-file: path/to/dagger.json
Why is this important to you?
This will simplify the process of upgrading Dagger.
How are you currently working around this?
Updating Dagger requires updating the version number in multiple places (dagger.json and every GitHub workflow YAML file which uses this action).
Note: this only works if you check out the code first (which isn't a requirement).
I wanted to open up the same feature request. Makes sense to improve the UX, event if it won't be applicable in all cases.
I've put something together: https://github.com/marketplace/actions/dagger-version
See it in action: https://github.com/openmeterio/openmeter/pull/1753
As I understand dagger-for-github does not support it directly but via another actions/dagger-version it works!
Correct
Thanks, tried it out now, and it looks good → https://github.com/goharbor/harbor-cli/pull/222
IMO this issue can be closed as a good alternative exists.