SebRollen / toml-action

14 stars 8 forks source link

Do not cause error if parent of nested field (section) is missing #13

Open adrianschmidt opened 1 year ago

adrianschmidt commented 1 year ago

When using this action to access a nested field, like in the example in the readme:

uses: SebRollen/toml-action@v1.0.2
id: read_toml
with:
  file: 'myfile.toml'
  field: 'package.version'

If the package section of the TOML file is missing, this action produces an error.

I would like the action to instead return an empty value. The reason for this is that once the step using this action has errored, the workflow has failed, and there is, to my knowledge, nothing that I can do to "ignore" that error.

If it's useful to some users that the action indeed produces an error, the behaviour could be controlled by a parameter.