sharpliner / sharpliner

Use C# instead of YAML to define your Azure DevOps pipelines
https://www.nuget.org/packages/Sharpliner/
MIT License
285 stars 21 forks source link

RepositoryResource won't let me use dashes (-) in the idenfier in the constructor #223

Closed thomhurst closed 1 year ago

thomhurst commented 1 year ago

I'm passing in an identifier name in the RepositoryResource constructor and getting a message around only being allowed A-Z, a-z, 0-9 and underscore.

My existing pipeline has dashes and works fine.

Sharpliner.targets(20, 5): [MSB4018] The "PublishDefinitions" task failed unexpectedly. System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.FormatException: Invalid identifier 'core-azurepipelines-templates'! Only A-Z, a-z, 0-9, and underscore are allowed. at Sharpliner.AzureDevOps.Pipeline.ValidateName(String name) at Sharpliner.AzureDevOps.RepositoryResource..ctor(String identifier) at PipelineGenerator.MyPipeline..ctor() in C:\me\pipeline\generator\PipelineGenerator\MyPipeline.cs:line 11 at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) --- End of inner exception stack trace --- at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) at System.Activator.CreateInstance(Type type, Boolean nonPublic, Boolean wrapExceptions) at Sharpliner.SharplinerPublisher.FindAllImplementations[T](Assembly assembly) at Sharpliner.SharplinerPublisher.Publish(String assemblyPath, Boolean failIfChanged)

premun commented 1 year ago

Thanks for logging this, fix is here - https://github.com/sharpliner/sharpliner/pull/225 I will publish a new version shortly.

premun commented 1 year ago

This fix will be in a version 1.3.7 in about 15 minutes