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

Extra characters added when formatting gitlab ci with yaml anchors #12

Open
brycefranzen opened this issue Apr 11, 2023 · 0 comments
Open

Comments

@brycefranzen
Copy link

When formatting a yaml file with anchors, extra characters (!!merge) are added on format which invalidates the file.

This is an issue specifically with the <<: *partial anchor. Or even more specifically the << part of it.
https://docs.gitlab.com/ee/ci/yaml/yaml_optimization.html

Before save:

deploy-mr:
  <<: *mr_deployer_config
  script:
  - *set_env_params
  - npm run start
  rules:
  - if: $CI_MERGE_REQUEST_ID && $CI_PIPELINE_SOURCE == "parent_pipeline"

After save:

deploy-mr:
  !!merge <<: *mr_deployer_config
  script:
  - *set_env_params
  - npm run start
  rules:
  - if: $CI_MERGE_REQUEST_ID && $CI_PIPELINE_SOURCE == "parent_pipeline"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant