Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Null service results in silent failure #475

Open
socketbox opened this issue Mar 30, 2023 · 0 comments
Open

Null service results in silent failure #475

socketbox opened this issue Mar 30, 2023 · 0 comments

Comments

@socketbox
Copy link

Excerpt:

        name: Deploy Amazon ECS task definition
        uses: aws-actions/amazon-ecs-deploy-task-definition@v1
        with:
          task-definition: ${{ steps.pbsorg-task-def.outputs.task-definition }}
          service: ${{ env.service_name }}
          cluster: ${{ env.cluster_name }}
          wait-for-service-stability: true

With an incorrect service name, the step that includes this action does not fail, even though the relevant service is not updated.

In this particular case, the service name ends up evaluating to null because there is no environment variable service_name (if the service name is not null but simply incorrect, then an error is produced and failure results).

As the logs below show, because the service value evaluates to null, the action is called without any service name argument whatsoever. And so the service goes un-updated, but no failure is indicated.

##[debug]..Evaluating String:
##[debug]..=> 'task-definition'
##[debug]=> '/home/runner/work/_temp/task-definition--2436-LsXDAQty8uw7-.json'
##[debug]Result: '/home/runner/work/_temp/task-definition--2436-LsXDAQty8uw7-.json'
##[debug]Evaluating: env.service_name
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'service_name'
##[debug]=> null
##[debug]Result: null
##[debug]Evaluating: env.cluster_name
##[debug]Evaluating Index:
##[debug]..Evaluating env:
##[debug]..=> Object
##[debug]..Evaluating String:
##[debug]..=> 'cluster_name'
##[debug]=> 'QA'
##[debug]Result: 'QA'
##[debug]Loading env
Run aws-actions/amazon-ecs-deploy-task-definition@v1
  with:
    task-definition: /home/runner/work/_temp/task-definition--[24](https://github.com/pbs/pbsorg/actions/runs/4566453356/jobs/8059145939#step:13:24)[36](https://github.com/pbs/pbsorg/actions/runs/4566453356/jobs/8059145939#step:13:36)-LsXDAQty8uw7-.json
    cluster: QA
    wait-for-service-stability: true
...
##[debug]Registering the task definition
...
##[debug]Service was not specified, no service updated
##[debug]Node Action run completed with exit code 0
##[debug]Set output task-definition-arn = arn:aws:ecs:***:***:task-definition/pbsorg-staging-web:[71](https://github.com/pbs/pbsorg/actions/runs/4566453356/jobs/8059145939#step:13:72)4
##[debug]Finishing: Deploy Amazon ECS task definition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant