From 66bda643624d7a15eb91dc4b5b0bdb345579da20 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Wed, 4 Nov 2020 12:17:18 -0800 Subject: [PATCH 1/2] Slack notification on issue or pull requests --- .github/workflows/slack-notify-issues.yml | 20 ++++++++++++++++++++ .github/workflows/slack-notify-pr.yml | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/slack-notify-issues.yml create mode 100644 .github/workflows/slack-notify-pr.yml diff --git a/.github/workflows/slack-notify-issues.yml b/.github/workflows/slack-notify-issues.yml new file mode 100644 index 0000000..7a874da --- /dev/null +++ b/.github/workflows/slack-notify-issues.yml @@ -0,0 +1,20 @@ +on: + issues: + types: [opened, reopened, deleted, closed] +name: Slack Issue Notification +jobs: + slackNotification: + name: Slack Notification Issue + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Slack Notification Issue + uses: rtCamp/action-slack-notify@master + env: + SLACK_CHANNEL: partnereng-issues + SLACK_COLOR: '#00A86B' + SLACK_ICON: https://pbs.twimg.com/profile_images/978188446178082817/86ulJdF0.jpg + SLACK_TITLE: "[${{ github.event.issue.state}}] ${{ github.event.issue.title }} on ${{ github.repository }} :rocket:" + SLACK_MESSAGE: 'Link: ${{ github.event.issue.url }}' + SLACK_USERNAME: PartnerEngineers + SLACK_WEBHOOK: ${{ secrets.SLACK_ISSUE_WEBHOOK }} diff --git a/.github/workflows/slack-notify-pr.yml b/.github/workflows/slack-notify-pr.yml new file mode 100644 index 0000000..7a874da --- /dev/null +++ b/.github/workflows/slack-notify-pr.yml @@ -0,0 +1,20 @@ +on: + issues: + types: [opened, reopened, deleted, closed] +name: Slack Issue Notification +jobs: + slackNotification: + name: Slack Notification Issue + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Slack Notification Issue + uses: rtCamp/action-slack-notify@master + env: + SLACK_CHANNEL: partnereng-issues + SLACK_COLOR: '#00A86B' + SLACK_ICON: https://pbs.twimg.com/profile_images/978188446178082817/86ulJdF0.jpg + SLACK_TITLE: "[${{ github.event.issue.state}}] ${{ github.event.issue.title }} on ${{ github.repository }} :rocket:" + SLACK_MESSAGE: 'Link: ${{ github.event.issue.url }}' + SLACK_USERNAME: PartnerEngineers + SLACK_WEBHOOK: ${{ secrets.SLACK_ISSUE_WEBHOOK }} From dbe3e821f1669e2d22ce623d7d216b417c3f19b7 Mon Sep 17 00:00:00 2001 From: John Peterson Date: Wed, 4 Nov 2020 12:19:00 -0800 Subject: [PATCH 2/2] Slack notification on issue or pull requests --- .github/workflows/slack-notify-pr.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/slack-notify-pr.yml b/.github/workflows/slack-notify-pr.yml index 7a874da..d1eee3b 100644 --- a/.github/workflows/slack-notify-pr.yml +++ b/.github/workflows/slack-notify-pr.yml @@ -1,20 +1,22 @@ on: - issues: - types: [opened, reopened, deleted, closed] -name: Slack Issue Notification + pull_request: + branches: + - master + types: [opened, reopened, closed] +name: Slack Pull Request Notification jobs: slackNotification: - name: Slack Notification Issue + name: Slack Notification PR runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Slack Notification Issue + - name: Slack Notification PR uses: rtCamp/action-slack-notify@master env: - SLACK_CHANNEL: partnereng-issues + SLACK_CHANNEL: partnereng-pullrequest SLACK_COLOR: '#00A86B' SLACK_ICON: https://pbs.twimg.com/profile_images/978188446178082817/86ulJdF0.jpg - SLACK_TITLE: "[${{ github.event.issue.state}}] ${{ github.event.issue.title }} on ${{ github.repository }} :rocket:" - SLACK_MESSAGE: 'Link: ${{ github.event.issue.url }}' + SLACK_TITLE: "[${{ github.event.pull_request.state}}] ${{ github.event.pull_request.title }} on ${{ github.repository }} :rocket:" + SLACK_MESSAGE: 'Merging from ${{ github.head_ref }} to ${{ github.base_ref }} by ${{ github.actor }}. Link: ${{ github.event.pull_request._links.html.href }}' SLACK_USERNAME: PartnerEngineers - SLACK_WEBHOOK: ${{ secrets.SLACK_ISSUE_WEBHOOK }} + SLACK_WEBHOOK: ${{ secrets.SLACK_PR_WEBHOOK }} \ No newline at end of file