Skip to content

Commit

Permalink
Pass in status of job from calling action step
Browse files Browse the repository at this point in the history
Correct branch for jade-data-ui
snf2ye committed Jan 11, 2024
1 parent e1855d5 commit a52e5d8
Showing 5 changed files with 14 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/dev-image-update.yaml
Original file line number Diff line number Diff line change
@@ -102,6 +102,8 @@ jobs:
needs: [ update_image, helm_tag_bump, cherry_pick_image_to_production_gcr ]
uses: ./.github/workflows/notify-slack.yaml
secrets: inherit
if: ${{ !cancelled() }}
with:
workflow_name: Dev Image Update
notify_on_success: true
success: ${{ needs.update_image.result == 'success' && needs.helm_tag_bump.result == 'success' && needs.cherry_pick_image_to_production_gcr.result == 'success' }}
2 changes: 2 additions & 0 deletions .github/workflows/helmtagbump.yaml
Original file line number Diff line number Diff line change
@@ -113,8 +113,10 @@ jobs:
needs: [ integration_helm_tag_update, ui_helm_default_chart_tag ]
uses: ./.github/workflows/notify-slack.yaml
secrets: inherit
if: ${{ !cancelled() }}
with:
workflow_name: Helm Tag Bump
notify_on_failure: ${{ inputs.notify-slack }}
notify_on_success: ${{ inputs.notify-slack }}
success: ${{ needs.integration_helm_tag_update.result == 'success' && needs.ui_helm_default_chart_tag.result == 'success' }}

9 changes: 6 additions & 3 deletions .github/workflows/notify-slack.yaml
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ env:
on:
workflow_call:
inputs:
success:
required: true
type: boolean
workflow_name:
required: true
type: string
@@ -27,10 +30,10 @@ on:
jobs:
notify-slack:
runs-on: ubuntu-latest
if: ${{ !cancelled() && github.ref == 'refs/heads/develop' }}
if: ${{ github.ref == 'refs/heads/develop' }}
steps:
- name: Notify slack on failure
if: inputs.notify_on_failure && failure()
if: ${{ inputs.notify_on_failure && !inputs.success }}
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: ${{ inputs.failure_slack_channel_id }}
@@ -55,7 +58,7 @@ jobs:
env:
SLACK_BOT_TOKEN: ${{ env.SLACK_BOT_TOKEN}}
- name: Notify slack on Success
if: inputs.notify_on_success && success()
if: ${{ inputs.notify_on_success && inputs.success }}
uses: slackapi/slack-github-action@v1.24.0
with:
channel-id: ${{ inputs.success_slack_channel_id }}
2 changes: 2 additions & 0 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
@@ -118,8 +118,10 @@ jobs:
needs: [e2e_test]
uses: ./.github/workflows/notify-slack.yaml
secrets: inherit
if: ${{ !cancelled() }}
with:
workflow_name: Nightly E2E Tests
notify_on_success: true
failure_slack_channel_id: "CMYTGJVFY,C53JYBV9A" # #jade-alerts & #dsde-qa
success_slack_channel_id: "CK9M0ENRJ,C53JYBV9A" # #jade-spam & #dsde-qa
success: ${{ needs.e2e_test.result == 'success' }}
2 changes: 2 additions & 0 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
@@ -37,6 +37,8 @@ jobs:
needs: [ unit_test ]
uses: ./.github/workflows/notify-slack.yaml
secrets: inherit
if: ${{ !cancelled() }}
with:
workflow_name: Nightly Unit Tests
notify_on_success: true
success: ${{ needs.unit_test.result == 'success' }}

0 comments on commit a52e5d8

Please sign in to comment.