Skip to content

Commit

Permalink
Merge pull request #18 from crecine/notify_teams
Browse files Browse the repository at this point in the history
Notify teams
  • Loading branch information
crecine authored Jan 25, 2024
2 parents f07d819 + 383bd9e commit b663d02
Showing 1 changed file with 4 additions and 36 deletions.
40 changes: 4 additions & 36 deletions .github/workflows/notify_teams.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:

jobs:
send_email_on_opened_pr:
if: github.event_name == 'pull_request' && github.event.action == 'opened'
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && (github.event.action == 'opened' || github.event.action == 'reopened')
runs-on: ubuntu-latest
steps:
- name: Get PR Data
Expand All @@ -37,7 +37,7 @@ jobs:
password: ${{ env.EMAIL_PASSWORD }}
to: ${{ env.EMAIL_TO }}
from: ${{ env.EMAIL_FROM }}
subject: "***Notification*** New Pull Request: ${{ env.number }}"
subject: "***Notification*** Opened Pull Request: ${{ env.number }}"
body: |
{
"action": "${{ env.action }}",
Expand All @@ -51,40 +51,8 @@ jobs:
nodemailerlog: true
nodemailerdebug: true

send_email_on_reopened_pr:
if: github.event_name == 'pull_request' && github.event.action == 'reopened'
runs-on: ubuntu-latest
steps:
- name: Get PR Data
run: |
echo "action=${{ github.event.action }}" >> $GITHUB_ENV
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "user=${{ github.event.pull_request.user.login }}" >> $GITHUB_ENV
echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
- name: Send Email on Reopened PR
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ env.SMTP_SERVER }}
server_port: ${{ env.SMTP_PORT }}
username: ${{ env.EMAIL_USERNAME }}
password: ${{ env.EMAIL_PASSWORD }}
to: ${{ env.EMAIL_TO }}
from: ${{ env.EMAIL_FROM }}
subject: "***Notification*** Reopened: ${{ env.number }}"
body: |
{
"action": "${{ env.action }}",
"number": "${{ env.number }}",
"user": "${{ env.user }}",
"title": "${{ env.title }}"
}
ignore_cert: true
nodemailerlog: true
nodemailerdebug: true

send_email_on_updated_assignees:
if: github.event_name == 'pull_request' && github.event.action == 'assigned'
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'assigned'
runs-on: ubuntu-latest
steps:
- name: Get Updated Assignees
Expand Down Expand Up @@ -114,7 +82,7 @@ jobs:
nodemailerdebug: true

send_email_on_closed_pr:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
if: (github.event_name == 'pull_request' || github.event_name == 'pull_request_target') && github.event.action == 'closed'
runs-on: ubuntu-latest
steps:
- name: Get PR Data
Expand Down

0 comments on commit b663d02

Please sign in to comment.