Skip to content

Slack Notification

Slack Notification #95

name: Slack Notification
on:
workflow_dispatch:
workflow_run:
workflows:
- Cli Release
branches: [main]
types:
- completed
jobs:
get-branch:
name: Get Current Branch Name
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
if: ${{ github.event.workflow_run.conclusion != 'failure' }}
steps:
- name: Extract branch name
id: extract_branch
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
wait-for-releases:
name: Wait for Docker, Homebrew, RPM and Platform executables Release
runs-on: ubuntu-latest
needs: [ get-branch ]
env:
INPUT_OWNER: twilio
INPUT_REPO: twilio-cli
INPUT_GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
INPUT_REF: ${{ needs.get-branch.outputs.branch }}
INPUT_WAITING_INTERVAL: 10
INPUT_PROPAGATE_FAILURE: true
INPUT_TRIGGER_WORKFLOW: false
steps:
- name: Checkout cli repo
uses: actions/checkout@v2
- name: Wait for Docker Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: docker-release.yml
- name: Wait for Oclif, Homebrew and Scoop Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: oclif-release.yml
- name: Wait for debian executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: debian-executable-release.yml
- name: Wait for windows executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: windows-executable-release.yml
- name: Wait for RPM Build
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: rpmbuild.yml
- name: Wait for macos executables Release
run: source .github/scripts/trigger-and-wait.sh
env:
INPUT_WORKFLOW_FILE_NAME: macos-executable-release.yml
notify-complete-success:
needs: [ wait-for-releases ]
name: Notify Release Completed
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Slack Notification
uses: rtCamp/action-slack-notify@v2
env:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEB_HOOK }}
SLACK_COLOR: "#36a64f"
SLACK_USERNAME: CLI Release Bot
SLACK_ICON_EMOJI: ":ship:"
SLACK_TITLE: 'Twilio CLI'
SLACK_MESSAGE: 'Release Completed.'
MSG_MINIMAL: actions url