-
Notifications
You must be signed in to change notification settings - Fork 5
62 lines (54 loc) · 2.1 KB
/
Copy pathdaily-status.yaml
File metadata and controls
62 lines (54 loc) · 2.1 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Daily Status E-Mail
on:
schedule:
- cron: '5 23 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v6
- name: Checkout ci-reports repository
uses: actions/checkout@v6
with:
repository: datalad/git-annex-ci-reports
token: ${{ secrets.DATALAD_GITHUB_TOKEN }}
path: git-annex-ci-reports
- name: Install Python
uses: actions/setup-python@v6
with:
python-version: '^3.10'
- name: Install dependencies
run: python -m pip install --upgrade pip 'pip-run!=8.4' wheel
- name: Generate e-mail content
id: content
run: |
fpath="$(date +%Y/%m/%d.html)"
mkdir -p "$(date +%Y/%m)"
subject="$(python -m pip-run -q -- "$GITHUB_WORKSPACE"/.github/workflows/tools/daily-status.py "$fpath")"
echo "subject=$subject" >> "$GITHUB_OUTPUT"
ln -f -s "$fpath" index.html
git config --global user.email "test@github.land"
git config --global user.name "GitHub Almighty"
git add .
git commit -m "[daily-status] $subject"
git push
working-directory: git-annex-ci-reports
env:
GITHUB_TOKEN: ${{ secrets.DATALAD_GITHUB_TOKEN }}
- name: Send e-mail
# freeze to v6
uses: dawidd6/action-send-mail@ba302ba66e88942841281c984a6b31ca6d6289e6
with:
server_address: ${{ secrets.NOTIFY_SMTP_HOST }}
server_port: ${{ secrets.NOTIFY_SMTP_PORT }}
username: ${{ secrets.NOTIFY_SMTP_USERNAME }}
password: ${{ secrets.NOTIFY_SMTP_PASSWORD }}
secure: ${{ secrets.NOTIFY_SMTP_SECURE }}
ignore_cert: ${{ secrets.NOTIFY_SMTP_IGNORE_CERT }}
from: "GitHub Actions Notifications <${{ secrets.NOTIFY_SMTP_USERNAME }}@${{ secrets.NOTIFY_SMTP_HOST }}>"
to: ${{ secrets.DAILY_STATUS_RECIPIENTS }}
subject: ${{ steps.content.outputs.subject }}
html_body: file://git-annex-ci-reports/index.html
# vim:set sts=2: