bcoe / conventional-release-labels

Apply labels for automatically generated release notes, based on conventionalcommits.org
Apache License 2.0
322 stars 14 forks source link

Config Option: 'type_labels' expects JSON, not YAML map #29

Open grayside opened 2 years ago

grayside commented 2 years ago

Despite the example type_labels mapping showing a serialized JSON 1-liner, I didn't process the idea of embedding JSON config inside YAML. This led to a somewhat obscure error when my workflow tried to execute:

Invalid workflow file
The workflow is not valid. .github/workflows/auto-label.yml (Line: 32, Col: 13): A mapping was not expected

I have a pending fix in https://github.com/GoogleCloudPlatform/emblem/pull/391.

More explicit documentation that JSON string is expected (such as a complete example showing use of that configuration), or support for a YAML maps would have made my experience as a first-time user easier.

taylor-white-zocdoc commented 2 years ago

I agree, a complete example consuming this configuration would be helpful. @grayside, do you happen to have a working example in a public repo at the moment?

gardar commented 1 year ago

Using a single line string can quickly make the configuration ugly, but a literal block scalar can be used to make the config a bit nicer, documenting an example here in case it helps others:

so from this:

- uses: bcoe/conventional-release-labels@v1
   with:
     type_labels: '{"feat": "feature", "fix": "fix", "breaking": "breaking"}'

to this:

- uses: bcoe/conventional-release-labels@v1
   with:
     type_labels: |
         {
         "feat": "feature",
         "fix": "fix",
         "breaking": "breaking"
         }