-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (42 loc) · 1.61 KB
/
send_commit_author_email.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Send-Commit-Author-Email.
# Run this workflow every time a new commit pushed to your repository
on: push
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
send-email:
# Name the Job
name: Send Author Email
# Set the type of machine to run on
runs-on: ubuntu-latest
steps:
- name: checkout repository
uses: actions/checkout@v2
- name: Expose git commit data
uses: rlespinasse/[email protected]
- name: Print git commit data
run: |
echo "Get author info"
echo " - ${{ env.GIT_COMMIT_AUTHOR }}"
echo " - ${{ env.GIT_COMMIT_AUTHOR_NAME }}"
echo " - ${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"
echo "Get committer info"
echo " - ${{ env.GIT_COMMIT_COMMITTER }}"
echo " - ${{ env.GIT_COMMIT_COMMITTER_NAME }}"
echo " - ${{ env.GIT_COMMIT_COMMITTER_EMAIL }}"
echo "Get message info"
echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT }}"
echo " - ${{ env.GIT_COMMIT_MESSAGE_SUBJECT_SANITIZED }}"
echo " - ${{ env.GIT_COMMIT_MESSAGE_BODY }}"
- name: "test"
run: |
echo " - $WEBHOOK_URL"
env: # Or as an environment variable
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
- uses: fjogeleit/http-request-action@master
with:
url: ${{ secrets.WEBHOOK_URL }}
method: 'POST'
data: '{"email": "${{ env.GIT_COMMIT_AUTHOR_EMAIL }}"}'
env: # Or as an environment variable
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}