Skip to content

Option to quote version in generated config to prevent misinterpretation #36

Description

@mdegat01

Problem/Motivation

On the edge repository of my addon I follow the same pattern as Home Assistant Community Add-ons and use the commit hash as the version number. The problem is that for the last update I pushed out the hash was 58899e0. This created an issue because that's actually a number if put unquoted in YAML which this action does when it generates the config.yaml file. Supervisor then misinterpreted this as version 58899.0 which caused me to be unable to update.

I realize this is probably quite rare but since it did happen I figured I would report it.

Expected behavior

Generated config.yaml contains the following:

version: '58899e0'

Actual behavior

Generated config.yaml contained this:

version: 58899e0

Here is the full config file for my add-on as generated by this action at the time of the issue.

Steps to reproduce

  1. Use repository updater to update an addon to version 58899e0
  2. Attempt to install/update that add-on in supervisor
    image
    image

Proposed changes

It would be good if the action had an input specifying whether to quote the value in the version field to prevent misinterpretation. Or perhaps if it quoted by default with an option to turn that off since I think most people likely use strings (semver, datever, commit hash, etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    no-staleThis issue or PR is exempted from the stable bot.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions