Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Substituting an int & multiple yaml files in one document #25

@mwhelanmachship

Description

@mwhelanmachship

Hi,

I am using this action to substitute values into a Kubernetes config file.

Substituting an integer;
I am trying to substitute a variable into the replicas value field on a k8s deployment config file.
This is how I call the substitution in the Github action file.

- name: Variable Substitution uses: microsoft/variable-substitution@v1 with: files: 'deploy-k8s.yaml' env: spec.replicas: 2

However when I substitute the integer the value substituted is given quotation marks.
The value substituted in the yaml file is
replicas: '2'

The yaml file just expects an int here and so will not deploy.
Is there any way to remove the quotes around the int when it is substituted?

Multiple Yaml Files
In the same document, I have two yaml files.
One which creates a deployment and the other creates a service.

When I try to substitute values in this file I get the below error.

Run microsoft/variable-substitution@v1 Error: Error: Could not parse file: deploy-k8s.yaml JSON parse error: SyntaxError: Unexpected token a in JSON at position 0 XML parse error: Error: Incomplete documentYAML parse error: YAMLException: expected a single document in the stream, but found more

When I comment out the service config, the substitution works fine.
Is there anyway to use this github action with YAML config files in the one document?

Thanks for your help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions