Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
workloadmgr / .github / workflows / notifyOnMerge.yml
Size: Mime:
name: NotifySlackOnMerge

on:
  workflow_dispatch:
  pull_request:
    types: [closed]
    branches:
      - dev-maint3/5.2
      - maint/5.2
      - dev-wip_feature_multi_backuptarget/6.0
      - dev-wip_feature_advanced_scheduler/6.0

env:
  SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
  SLACK_CHANNEL: "#${{ vars.SLACK_NOTIF_CHANNEL }}" #Defined as repo name-notif in Settings>secrets & variables. Eg. workloadmanager-notif
  REPO_OWNER: "trilioData"
  GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}

jobs:
  notify-slack:
    runs-on: ubuntu-latest
    steps:
      - name: Generate Timestamp
        id: timestamp
        run: |
         echo "TIMESTAMP=$(date -u +"%Y-%m-%dT%H:%M:%SZ")" >> $GITHUB_ENV
      - name: Send Slack notification
        if: github.repository_owner == '${{ env.REPO_OWNER }}''
        run: |
         echo "PR_MERGED=${{ github.event.pull_request.merged }}"
         echo "PR_NUMBER: ${{ github.event.pull_request.number }}"
         echo "PR_TITLE: ${{ github.event.pull_request.title }}"
         echo "PR_URL: ${{ github.event.pull_request.html_url }}"
         echo "TIMESTAMP : ${{ env.TIMESTAMP }}"
         curl -X POST -H 'Content-type: application/json' --data '{
            "channel": "${{ env.SLACK_CHANNEL }}",
            "text": "New GitHub Event",
            "blocks": [{
              "type": "section",
              "text": {
                "type": "mrkdwn",
                "text": "PR Merged at ${{ env.TIMESTAMP }} ``` PR : ${{ github.event.pull_request.html_url }} \n Branch : ${{ github.ref_name }}```"
               }
            }]
          }' $SLACK_WEBHOOK_URL