Skip to content

Daily Status E-Mail #997

Daily Status E-Mail

Daily Status E-Mail #997

Workflow file for this run

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@v4
- name: Checkout ci-reports repository
uses: actions/checkout@v4
with:
repository: datalad/git-annex-ci-reports
token: ${{ secrets.DATALAD_GITHUB_TOKEN }}
path: git-annex-ci-reports
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: '^3.9'
- 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 "[email protected]"
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
uses: dawidd6/action-send-mail@v4
with:
server_address: ${{ secrets.NOTIFY_SMTP_HOST }}
server_port: ${{ secrets.NOTIFY_SMTP_PORT }}
username: ${{ secrets.NOTIFY_SMTP_USERNAME }}
password: ${{ secrets.NOTIFY_SMTP_PASSWORD }}
from: GitHub Actions Notifications
to: ${{ secrets.DAILY_STATUS_RECIPIENTS }}
subject: ${{ steps.content.outputs.subject }}
html_body: file://git-annex-ci-reports/index.html
# vim:set sts=2: