Skip to content

Commit

Permalink
(PC-32510) chore(pipeline): add condition to slack notify (#7058)
Browse files Browse the repository at this point in the history
  • Loading branch information
NolwenMajorFrances authored Oct 21, 2024
1 parent 60e41cc commit 701872a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:

slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
if: ${{contains(needs.sentry_and_deploy.result, 'success') && contains(needs.sentry_and_deploy.result, 'failure')}}
needs: sentry_and_deploy
steps:
- name: Connect to Secret Manager
Expand All @@ -129,13 +129,13 @@ jobs:
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#A30002","#36a64f"]')[steps.sentry_and_deploy.outputs.status == 'success'] }}",
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[needs.sentry_and_deploy.result == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement Android sur `${{ inputs.ENV }}` a ${{ fromJSON('["échoué :boom:","réussi :rocket:"]')[steps.sentry_and_deploy.outputs.status == 'success'] }}"
"text": "Le déploiement Android sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[needs.sentry_and_deploy.result == 'failure'] }}"
}
],
"unfurl_links": false,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_on_workflow_environment_ios_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:

slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
if: ${{ contains(needs.sentry_and_deploy.result, 'success') && contains(needs.sentry_and_deploy.result, 'failure')}}
needs: sentry_and_deploy
steps:
- name: Connect to Secret Manager
Expand All @@ -120,13 +120,13 @@ jobs:
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#A30002", "#36a64f"]')[steps.sentry_and_deploy.outputs.status == 'success'] }}",
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[needs.sentry_and_deploy.result == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement iOS sur `${{ inputs.ENV }}` a ${{ fromJSON('["échoué :boom:","réussi :rocket:"]')[steps.sentry_and_deploy.outputs.status == 'success'] }}"
"text": "Le déploiement iOS sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[needs.sentry_and_deploy.result == 'failure'] }}"
}
],
"unfurl_links": false,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_on_workflow_environment_soft_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:

slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
if: ${{ contains(needs.sentry_and_deploy.result, 'success') && contains(needs.sentry_and_deploy.result, 'failure')}}
needs: sentry_and_deploy
steps:
- name: Connect to Secret Manager
Expand All @@ -111,13 +111,13 @@ jobs:
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#A30002","#36a64f"]')[steps.sentry_and_deploy.outputs.status == 'success'] }}",
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[needs.sentry_and_deploy.result == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement codePush Android/iOS sur `${{ inputs.ENV }}` a ${{ fromJSON('["échoué :boom:","réussi :rocket:"]')[steps.sentry_and_deploy.outputs.status == 'success'] }}"
"text": "Le déploiement codePush Android/iOS sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[needs.sentry_and_deploy.result == 'failure'] }}"
}
],
"unfurl_links": false,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_on_workflow_web_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ jobs:
gsutil cp dist/index.html gs://${{ inputs.BUCKET_NAME }}
slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
if: ${{ contains(needs.web_deploy.result, 'success') && contains(needs.web_deploy.result, 'failure')}}
needs: web_deploy
steps:
- name: Connect to Secret Manager
Expand All @@ -101,13 +101,13 @@ jobs:
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#A30002","#36a64f"]')[steps.web_deploy.outputs.status == 'success'] }}",
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[needs.web_deploy.result == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement Web sur `${{ inputs.ENV }}` a ${{ fromJSON('["échoué :boom:","réussi :rocket:"]')[steps.web_deploy.outputs.status == 'success'] }}"
"text": "Le déploiement Web sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[needs.web_deploy.result == 'failure'] }}"
}
],
"unfurl_links": false,
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dev_on_workflow_web_proxy_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
| xargs gcloud app versions delete --service=web-proxy-${{ inputs.ENV }}
slack_notify:
runs-on: ubuntu-22.04
if: ${{ always() }}
if: ${{ contains(needs.web_proxy_deploy.result, 'success') && contains(needs.web_proxy_deploy.result, 'failure')}}
needs: web_proxy_deploy
steps:
- name: Connect to Secret Manager
Expand All @@ -100,13 +100,13 @@ jobs:
"attachments": [
{
"mrkdwn_in": ["text"],
"color": "${{ fromJSON('["#A30002","#36a64f"]')[steps.web_proxy_deploy.outputs.status == 'success'] }}",
"color": "${{ fromJSON('["#36a64f", "#A30002"]')[needs.web_proxy_deploy.result == 'failure'] }}",
"author_name": "${{github.actor}}",
"author_link": "https://github.com/${{github.actor}}",
"author_icon": "https://github.com/${{github.actor}}.png",
"title": "PCAPPNATIVE Deployment",
"title_link": "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}",
"text": "Le déploiement Web proxy sur `${{ inputs.ENV }}` a ${{ fromJSON('["échoué :boom:","réussi :rocket:"]')[steps.web_proxy_deploy.outputs.status == 'success'] }}"
"text": "Le déploiement Web proxy sur `${{ inputs.ENV }}` a ${{ fromJSON('["réussi :rocket:", "échoué :boom:"]')[needs.web_proxy_deploy.result == 'failure'] }}"
}
],
"unfurl_links": false,
Expand Down

0 comments on commit 701872a

Please sign in to comment.