Skip to content

premisedata/slack-build-notifications

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-build-notifcations

Github Action for build notifications to Slack

Parameters

The parameters will be passed to the action through with

Name Description Required?
outcome build outcome Required
project GCP project Required
build build number - passed as github-provided env var Required
webhook webhook url for slack app Required
repo name of github repo Required
version release version of the service Optional
notes release description Optional

Usage

  1. Create a directory named .github/workflow/

  2. Create a YAML file, e.g. action_workflow.yml, and place it in the created directory above

  3. Example content of the YAML file:

on:
  push:
    branches:
      - main
name: Deploy to GCP
jobs:
  deploy:
    name: deploy
    runs-on: ubuntu-latest
    env:
      GCLOUD_PROJECT: GCLOUD_PROJECT
    steps:
    - name: checkout
      uses: actions/checkout@v2
    - name: Setup Cloud SDK
      uses: google-github-actions/[email protected]
      with:
        project_id: ${{ env.GCLOUD_PROJECT }}
        service_account_key: ${{ secrets.GCP_SA_KEY }}
        export_default_credentials: true
    - name: Deploy to Cloud Run
      id: deploy
      uses: google-github-actions/[email protected]
      with:
        service: ${{ env.SERVICE }}
        region: ${{ env.REGION }}
        suffix: ${{ github.sha }}
    - name: send slack message
      uses: premisedata/[email protected]
      if: always()
      with:
        outcome: ${{ steps.deploy.outcome }}
        project: ${{ env.GCLOUD_PROJECT }}
        build: ${{ github.run_id }}
        webhook: https://hooks.slack.com/services/your_slack_webhook
        repo: ${{ env.GITHUB_REPOSITORY }}
        version: ${{ env.VERSION }}
        notes: ${{ github.GITHUB_REF_NAME }}

About

Github Action for build notifications to Slack

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •