Skip to content

GitSync/--deployment-files resolves wrong path for template-file-path #4265

@yannickvr

Description

@yannickvr

CloudFormation Lint Version

1.40.2

What operating system are you using?

Mac, Ubuntu

Describe the bug

ValueError: syncs/dev/my-service/cloudformation/my-service/cloudformation.yml could not be processed by glob.glob

We have a bit more complex set up than the tests, specifically, our sync files are not in the same directory as the cloudformation.

GitSync expects the template-file-path to point to a directory relative to the root of the repo, e.g.

cloudformation/template.yml

However, if the sync file is not placed in the root of the repo, CFN-lint tries to find the templatefile in it's PWD

so running cfn-lint --deployment-files against syncs/dev.yml will try to find the template at syncs/cloudformation/template.yml

Expected behavior

cfn-lint uses the current working directory, or repository root directory, to find the cloudformation template referenced by a sync file

Reproduction template

syncs/dev.yml

template-file-path: cloudformation/template.yml
parameters:
  environment: dev

cfn-lint --deployment-files syncs/dev.yml

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions