You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can see here that the previous steps failed however notify-slack-action's status is set to success which causes it not to alert since I have notify-when failure set.
Here's my custom action:
name: "Safe Amazon ECS Deploy Task Definition"
description: 'Deploy an Amazon ECS task definition "safely" (verify that the deployment was not rolled back)'
inputs:
service-name:
description: "The name of the service being deployed"
required: true
type: string
task-definition:
description: "The task definition to deploy"
required: true
type: string
cluster:
description: "The cluster to deploy to"
required: true
type: string
runs:
using: "composite"
steps:
- name: Deploy Amazon ECS task definition
uses: aws-actions/amazon-ecs-deploy-task-definition@v1
id: ecs-deploy
with:
task-definition: ${{ inputs.task-definition }}
service: ${{ inputs.service-name }}
cluster: ${{ inputs.cluster }}
wait-for-service-stability: true
- name: Check if deployment was successful
id: check-deployment
if: always()
run: |
CURRENT_TASK_DEF_ARN=$(aws ecs describe-services --cluster ${{ inputs.cluster }} --services ${{ inputs.service-name }} --query services[0].deployments[0].taskDefinition | jq -r ".")
NEW_TASK_DEF_ARN=${{ steps.ecs-deploy.outputs.task-definition-arn }}
echo "Current task arn: $CURRENT_TASK_DEF_ARN"
echo "New task arn: $NEW_TASK_DEF_ARN"
if [ "$CURRENT_TASK_DEF_ARN" != "$NEW_TASK_DEF_ARN" ]; then
echo "Deployment failed."
exit 1
fi
shell: bash
- name: Report Status
if: always()
uses: ravsamhq/notify-slack-action@v1
with:
status: ${{ job.status }}
notification_title: "{workflow} has {status_message}"
message_format: "{emoji} *{workflow}* {status_message} in <{repo_url}|{repo}> | <{run_url}|View Run>"
footer: "Linked Repo <{repo_url}|{repo}>"
# Only alert on failure to prevent spamming the channel
notify_when: "failure"
The text was updated successfully, but these errors were encountered:
Hello and welcome to RavSam 💜. Thanks for opening your first issue. I will assign one of our team members to take a look at the problem you have raised. Make sure to include as much information as possible to help our team diagnose the issue and solve it quickly.
If the problem is related to a security concern, then please delete this issue and send us an email at [email protected].
ylhan
changed the title
Status is set to success in failed custom action
Action is incorrectly detecting success and not sending notification
Jul 20, 2023
You can see here that the previous steps failed however
notify-slack-action
's status is set tosuccess
which causes it not to alert since I have notify-when failure set.Here's my custom action:
The text was updated successfully, but these errors were encountered: