Azure / container-apps-deploy-action

GitHub Action for building and deploying Azure Container Apps
MIT License
52 stars 29 forks source link

Error in action template #25

Closed nspyke closed 1 year ago

nspyke commented 1 year ago

When running this action with the following config

      - name: Deploy Container App
        uses: azure/container-apps-deploy-action@v0
        with:
          containerAppName: ${{ env.CONTAINER_NAME }}
          resourceGroup: rg-workloads-container-apps-stg
          containerAppEnvironment: cae-workloads-external-stg
          location: australiaeast
          imageToDeploy: ${{ env.ACR_REGISTRY }}/${{ env.CONTAINER_NAME }}:${{ needs.build.outputs.version }}
          acrUsername: ${{ env.ACR_USERNAME }}
          acrPassword: ${{ secrets.ACR_PASSWORD }}
          environmentVariables: |
            ConnectionStrings__Foo=${{ env.CONNECTION_STRING }}

I get these errors on job initialization (set up job).

Error: azure/container-apps-deploy-action/v0/action.yml (Line: 275, Col: 11):
Error: azure/container-apps-deploy-action/v0/action.yml (Line: [27](https://github.com/xxx/yyyyy/actions/runs/4154099689/jobs/7186257819#step:1:31)5, Col: 11):
Error: azure/container-apps-deploy-action/v0/action.yml (Line: 275, Col: 11): Unexpected symbol: '&&'. Located at position 57 within expression: runner.os == 'Windows' && inputs.appSourcePath != '' && && env.CA_GH_ACTION_DOCKERFILE_PATH == ''
Error: azure/container-apps-deploy-action/v0/action.yml (Line: 275, Col: 11): Unexpected symbol: '${{'. Located at position 1 within expression: ${{ runner.os == 'Windows' && inputs.appSourcePath != '' && && env.CA_GH_ACTION_DOCKERFILE_PATH == '' }}
Error: GitHub.DistributedTask.ObjectTemplating.TemplateValidationException: The template is not valid. azure/container-apps-deploy-action/v0/action.yml (Line: 275, Col: 11): Unexpected symbol: '&&'. Located at position 57 within expression: runner.os == 'Windows' && inputs.appSourcePath != '' && && env.CA_GH_ACTION_DOCKERFILE_PATH == '',azure/container-apps-deploy-action/v0/action.yml (Line: 275, Col: 11): Unexpected symbol: '${{'. Located at position 1 within expression: ${{ runner.os == 'Windows' && inputs.appSourcePath != '' && && env.CA_GH_ACTION_DOCKERFILE_PATH == '' }}
   at GitHub.DistributedTask.ObjectTemplating.TemplateValidationErrors.Check()
   at GitHub.Runner.Worker.ActionManifestManager.ConvertRuns(IExecutionContext executionContext, TemplateContext templateContext, TemplateToken inputsToken, String fileRelativePath, MappingToken outputs)
   at GitHub.Runner.Worker.ActionManifestManager.Load(IExecutionContext executionContext, String manifestFile)
Error: Fail to load azure/container-apps-deploy-action/v0/action.yml

Is this an error with my template or this action?

marviobezerra commented 1 year ago

I'm getting the same error and it's really blocking my team.

rubenmamo commented 1 year ago

I'm getting the same error. @marviobezerra you can get your workflow working again by targetting the previous version:

uses: azure/container-apps-deploy-action@47e03a783248cc0b5647f7ea03a8fb807fbc8e2f
danielmellqvist commented 1 year ago

Same here, I'm getting the same error.

larsmak commented 1 year ago

We're also getting this - after specifying an existing containerAppEnvironment, it was working prior to this.

marviobezerra commented 1 year ago

Changing my pipeline is going to be a painful process - approvals and etc. Especially because I'll need to change it back once it's fixed. What is the ETA to fix it?

danielmellqvist commented 1 year ago

The error message seems to suggest that there's a simple solution. Remove one of the && on line 275 in the file action.yml.

image

cormacpayne commented 1 year ago

Hey folks, apologies for this issue -- this has been resolved and the fix is now live in version v0 of the action.