-
Notifications
You must be signed in to change notification settings - Fork 3
50 lines (44 loc) · 1.43 KB
/
send-changelog-mail.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
46
47
48
49
name: Send Changelog Email
on:
workflow_dispatch:
workflow_run:
workflows: ["Ferry Run"]
types:
- completed
jobs:
send_mail:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: coursetable/ferry-data
path: data
ssh-key: ${{ secrets.REPO_SSH_KEY }}
sparse-checkout: |
change_log/
sparse-checkout-cone-mode: false
fetch-depth: 1
# Find the latest changelog file
- name: Find latest changelog file
id: find_changelog
run: |
FILE=$(ls data/change_log/*.md | sort | tail -n 1)
echo "FILE=$FILE" >> $GITHUB_ENV
# Extract the date/time from the filename
- name: Extract changelog date/time
run: |
FILE_NAME=$(basename "${FILE}")
DATE_TIME="${FILE_NAME%.md}"
echo "CHANGELOG_DATE_TIME=${DATE_TIME}" >> $GITHUB_ENV
- name: Send changelog email
uses: dawidd6/action-send-mail@v4
with:
server_address: smtp.gmail.com
server_port: 587
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
from: "CourseTable <[email protected]>"
to: ${{ secrets.MAIL_RECIPIENTS }}
subject: "[FERRY] Changelog - ${{ env.CHANGELOG_DATE_TIME }}"
html_body: "file://${{ env.FILE }}"
convert_markdown: true