Azure / spring-cloud-deploy

GitHub Actions for deploying to Azure Spring Cloud
MIT License
5 stars 10 forks source link

Error message: The type 'MappingToken' was expected. #8

Closed jdubois closed 2 years ago

jdubois commented 2 years ago

I'm trying to use this GitHub Action inside a composite action, which is available at https://github.com/microsoft/nubesgen-actions/blob/test-azure-spring-cloud-deployment/gitops-deploy-to-spring-cloud-java/action.yml

When running it, I get an error saying "The type 'MappingToken' was expected." - could you help me understand what this is? Here is the full log:


Download action repository 'microsoft/nubesgen-actions@test-azure-spring-cloud-deployment' (SHA:22144ed83cf0c2228ae82e1ebd74081af142c4b7)
32
Error: microsoft/nubesgen-actions/test-azure-spring-cloud-deployment/gitops-deploy-to-spring-cloud-java/action.yml:
33
Error: microsoft/nubesgen-actions/test-azure-spring-cloud-deployment/gitops-deploy-to-spring-cloud-java/action.yml: (Line: 33, Col: 13, Idx: 1331) - (Line: 33, Col: 13, Idx: 1331): Mapping values are not allowed in this context.
34
Error: System.ArgumentException: Unexpected type '' encountered while reading 'action manifest root'. The type 'MappingToken' was expected.
35
   at GitHub.DistributedTask.ObjectTemplating.Tokens.TemplateTokenExtensions.AssertMapping(TemplateToken value, String objectDescription)
36
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
37
Error: Fail to load microsoft/nubesgen-actions/test-azure-spring-cloud-deployment/gitops-deploy-to-spring-cloud-java/action.yml
RuoyuWang-MS commented 2 years ago

As described in this link https://stackoverflow.com/questions/44327773/mapping-values-are-not-allowed-in-this-context, the error may be casued by yaml format. Would you please check the line 33 and try to remove the unexpected spaces in front of uses and with. I think the format may be like that:

    - name: Deploy to Azure Spring Cloud
      uses: azure/spring-cloud-deploy@v1
      with:
        action: deploy
        service-name: ${{ env.SPRING_CLOUD_SERVICE_NAME }}
        app-name: ${{ env.APPLICATION_CAF_NAME }}
        use-staging-deployment: ${{ inputs.use_staging_deployment }}
        package: "*.[j,w]ar"

I hope this could help you !

jdubois commented 2 years ago

Oh I feel stupid ! I haven’t tested this yet, but it’s clearly the issue, so I’m closing this. Thank you.