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

🐛 Bug Report: Scaffolder template - If statement in output spec no applied #24805

Open
2 tasks done
gabriel-farache opened this issue May 16, 2024 · 1 comment
Open
2 tasks done
Labels
area:scaffolder Everything and all things related to the scaffolder project area enhancement New feature or request

Comments

@gabriel-farache
Copy link

📜 Description

In the output field of the template spec, if statement are not applied:

output:
    links:
      - if: ${{ parameters.CI === "Yes" }}
        title: Title
        url: URL

With the above spec, the link is always displayed even if CI is not equal to Yes

👍 Expected behavior

THe if statement should be matched and the link should only be applied/displayed if the condition matches

👎 Actual Behavior with Screenshots

The link is displayed no matter if the condition is matched.

👟 Reproduction steps

Create a template with the following or similar output spec:

output:
    links:
      - if: ${{ parameters.CI === "Yes" }}
        title: Title
        url: URL

📃 Provide the context for the Bug.

No response

🖥️ Your Environment

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

None

@gabriel-farache gabriel-farache added the bug Something isn't working label May 16, 2024
@github-actions github-actions bot added the area:scaffolder Everything and all things related to the scaffolder project area label May 16, 2024
@benjdlambert benjdlambert added enhancement New feature or request and removed bug Something isn't working labels May 16, 2024
@benjdlambert
Copy link
Member

benjdlambert commented May 16, 2024

Hey 👋 Thanks for raising this!

Unfortunately this isn't a bug, more of a feature request as the if option isn't supported on the outputs yet. Think it seems like a good idea though to be able to implement this.

The output object however is pretty unstructured, so wondering how best to implement this. The links part is standard, but there could be other properties in there so how do we best carry the if option into those blocks too, could be tricky.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:scaffolder Everything and all things related to the scaffolder project area enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants