diff --git a/.github/workflows/notify_teams.yml b/.github/workflows/notify_teams.yml index 3cbbb6c05..f821e6c20 100644 --- a/.github/workflows/notify_teams.yml +++ b/.github/workflows/notify_teams.yml @@ -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 @@ -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 }}", @@ -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 @@ -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