Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Retain two spaces between content and comment in yaml files #31360

Open
rarkins opened this issue Sep 12, 2024 Discussed in #31359 · 0 comments
Open

Retain two spaces between content and comment in yaml files #31360

rarkins opened this issue Sep 12, 2024 Discussed in #31359 · 0 comments
Labels
manager:github-actions Github actions manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)

Comments

@rarkins
Copy link
Collaborator

rarkins commented Sep 12, 2024

Discussed in #31359

Originally posted by zisuu September 12, 2024

Context and Proposal

By default, Renovate does not keep the two spaces between content and a comment in a yaml file when it needs to update the comment. This can lead to issues like Renovate PRs not getting merged if you have yamllint checks running, see this example Repo Pull Request: https://github.com/zisuu/yamllint-test/pull/1/files:

From:

      - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29  # v4.1.6

To:

      - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0

Ideas on how to solve this:

  • Renovate should retain the existing spacing if replacing an existing comment value (1 or 2). One space is not invalid YAML even if the main linter recommends against it
  • If Renovate is adding the comment, then let's default to two spaces like the linter recommends

This applies to the lib/modules/manager/github-actions code specifically.

Reproduction forked to https://github.com/renovate-reproductions/31359

@rarkins rarkins added type:feature Feature (new functionality) priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others manager:github-actions Github actions manager labels Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manager:github-actions Github actions manager priority-3-medium Default priority, "should be done" but isn't prioritised ahead of others type:feature Feature (new functionality)
Projects
None yet
Development

No branches or pull requests

1 participant