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

/expand endpoint returns template with additional character when there's a newline #925

Open
timhuynh94 opened this issue Mar 12, 2024 · 0 comments
Labels
bug Indicates a bug

Comments

@timhuynh94
Copy link
Contributor

Description

POST /api/v1/pipelines/{org}/{repo}/{pipeline}/expand returns an additional character such as 4 for newline in template
Example vela file:

# instructs Vela which syntax version we're using
version: "1"

# instructs Vela that we're going to create a steps pipeline
steps:
  # instructs Vela what the name of the step should be
  - name: build
    # instructs Vela what Docker image to use for this step
    image: golang:1.21
    # instructs Vela which environment variables to inject for this step
    environment:
      CGO_ENABLED: 0
    # instructs Vela which commands to run inside the step
    commands: |

      git config --global user.email "${VELA_BUILD_SENDER}@git.com"
      git config --global user.name "${VELA_BUILD_SENDER}"

Result:

version: "1"
metadata:
    environment:
        - steps
        - services
        - secrets
steps:
    - commands:
        - |4-
          git config --global user.email "${VELA_BUILD_SENDER}@git.com"
          git config --global user.name "${VELA_BUILD_SENDER}"
      image: golang:1.21
      name: build
      pull: not_present
      environment:
        CGO_ENABLED: "0"

Value

Even though it works, any integration relies on this particular endpoint would fail due to additional character inserted for newline

Useful Information

  1. What is the output of vela --version?

v0.23.1

  1. What operating system is being used?
  1. Any other important details?
@timhuynh94 timhuynh94 added the bug Indicates a bug label Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates a bug
Projects
None yet
Development

No branches or pull requests

1 participant