Skip to content

Set FLOPS mass default #902

Set FLOPS mass default

Set FLOPS mass default #902

Workflow file for this run

name: Notify Teams
on:
# Could also include pull_request
pull_request_target:
branches: [main]
types: [opened, reopened, assigned, closed, ready_for_review, converted_to_draft, review_requested]
jobs:
send_email_on_opened_pr:
if: github.event.action == 'opened' || github.event.action == 'reopened' || github.event.action == 'ready_for_review'
runs-on: ubuntu-latest
steps:
- name: Checkout actions
uses: actions/checkout@v3
with:
sparse-checkout: |
.github/actions
path: actions
- 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
echo "url=${{ github.event.pull_request.html_url }}" >> $GITHUB_ENV
echo "assignees=${{ join(github.event.pull_request.assignees.*.login, ',') }}" >> $GITHUB_ENV
echo "reviewers=${{ join(github.event.pull_request.requested_reviewers.*.login, ',') }}" >> $GITHUB_ENV
- name: Send Email on Opened PR
uses: ./actions/.github/actions/send_email
with:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
to: ${{ secrets.DESTINATION_EMAIL }}
subject: "***Notification*** Opened Pull Request: ${{ env.number }}"
body: |
{
"action": "${{ env.action }}",
"number": "${{ env.number }}",
"user": "${{ env.user }}",
"title": "${{ env.title }}",
"url": "${{ env.url }}",
"assignees": "${{ env.assignees }}",
"reviewers": "${{ env.reviewers }}"
}
send_email_on_updated_assignees:
if: github.event.action == 'assigned'
runs-on: ubuntu-latest
steps:
- name: Checkout actions
uses: actions/checkout@v3
with:
sparse-checkout: |
.github/actions
path: actions
- name: Get Updated Assignees
run: |
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "assignees=${{ join(github.event.pull_request.assignees.*.login, ',') }}" >> $GITHUB_ENV
echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
- name: Send Email on Updated Assignees
uses: ./actions/.github/actions/send_email
with:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
to: ${{ secrets.DESTINATION_EMAIL }}
subject: "***Notification*** Updated Assignees for Pull Request: ${{ env.number }}"
body: |
{
"number": "${{ env.number }}",
"assignees": "${{ env.assignees }}",
"title": "${{ env.title }}"
}
send_email_on_review_request:
if: github.event.action == 'review_requested'
runs-on: ubuntu-latest
steps:
- name: Checkout actions
uses: actions/checkout@v3
with:
sparse-checkout: |
.github/actions
path: actions
- name: Get Reviewers
run: |
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "reviewers=${{ join(github.event.pull_request.requested_reviewers.*.login, ',') }}" >> $GITHUB_ENV
echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
- name: Send Email on Reviewer Requested
uses: ./actions/.github/actions/send_email
with:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
to: ${{ secrets.DESTINATION_EMAIL }}
subject: "***Notification*** Updated Reviewers for Pull Request: ${{ env.number }}"
body: |
{
"number": "${{ env.number }}",
"reviewers": "${{ env.reviewers }}",
"title": "${{ env.title }}"
}
send_email_on_closed_pr:
if: github.event.action == 'closed' || github.event.action == 'converted_to_draft'
runs-on: ubuntu-latest
steps:
- name: Checkout actions
uses: actions/checkout@v3
with:
sparse-checkout: |
.github/actions
path: actions
- name: Get PR Data
run: |
echo "number=${{ github.event.pull_request.number }}" >> $GITHUB_ENV
echo "title=${{ github.event.pull_request.title }}" >> $GITHUB_ENV
- name: Send Email on Closed PR
uses: ./actions/.github/actions/send_email
with:
username: ${{ secrets.EMAIL_USERNAME }}
password: ${{ secrets.EMAIL_PASSWORD }}
to: ${{ secrets.DESTINATION_EMAIL }}
subject: "***Notification*** Closed Pull Request: ${{ env.number }}"
body: |
{
"number": "${{ env.number }}",
"title": "${{ env.title }}",
"action": "${{ env.action }}"
}