dagger-for-github icon indicating copy to clipboard operation
dagger-for-github copied to clipboard

✨ Get version from dagger.json

Open jsok opened this issue 1 year ago • 6 comments

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).

jsok avatar Jul 22 '24 01:07 jsok

Note: this only works if you check out the code first (which isn't a requirement).

sagikazarmark avatar Aug 09 '24 20:08 sagikazarmark

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.

Vad1mo avatar Oct 26 '24 10:10 Vad1mo

I've put something together: https://github.com/marketplace/actions/dagger-version

See it in action: https://github.com/openmeterio/openmeter/pull/1753

sagikazarmark avatar Oct 26 '24 12:10 sagikazarmark

As I understand dagger-for-github does not support it directly but via another actions/dagger-version it works!

Vad1mo avatar Oct 26 '24 12:10 Vad1mo

Correct

sagikazarmark avatar Oct 26 '24 12:10 sagikazarmark

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.

Vad1mo avatar Oct 26 '24 12:10 Vad1mo