Skip to content

Report

Report #60

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: Docker Run
uses: addnab/docker-run-action@v3
with:
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GH_PKG_PAT }}
registry: ghcr.io
image: ghcr.io/phnx47/harvest-report:latest
options: -v ${{ github.workspace }}:/app/out -e HARVEST_ACCESS_TOKEN=${{ secrets.HARVEST_ACCESS_TOKEN }} -e HARVEST_ACCOUNT_ID=${{ secrets.HARVEST_ACCOUNT_ID }}
run: node main.js >> out/report.txt
- 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 }}