Skip to content

Report

Report #105

Workflow file for this run

name: Report
on:
schedule:
- cron: "0 9 * * 5"
workflow_dispatch:
jobs:
send-report:
name: Send Report
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: npm i --omit=dev
- name: Generate report.txt
run: npm start >> report.txt
env:
HARVEST_ACCESS_TOKEN: ${{ secrets.HARVEST_ACCESS_TOKEN }}
HARVEST_ACCOUNT_ID: ${{ secrets.HARVEST_ACCOUNT_ID }}
HARVEST_CLIENT_ID: ${{ secrets.HARVEST_CLIENT_ID }}
- name: Read report.txt
id: report
uses: juliangruber/read-file-action@v1
with:
trim: true
path: ./report.txt
- name: Send email
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ secrets.MAIL_SERVER_ADDRESS }}
server_port: 465
username: ${{ secrets.MAIL_USERNAME }}
password: ${{ secrets.MAIL_PASSWORD }}
subject: Harvest-Report (${{ github.run_number }})
body: |
Generated via GitHub Actions [1]
${{ steps.report.outputs.content }}
[1] https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
to: ${{ secrets.MAIL_TO }}
from: ${{ secrets.MAIL_FROM }}