Files
awesome-docker/.github/workflows/health_report.yml
Julien Bisconti e5d5594775 feat: update all GitHub Actions workflows from Node.js to Go
Replace Node.js setup, npm install, and node/npm commands with
Go setup, go build, and the new awesome-docker CLI binary in all
four workflow files: pull_request, broken_links, health_report,
and deploy-pages.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 23:26:48 +01:00

75 lines
2.1 KiB
Markdown

name: Weekly Health Report
on:
schedule:
- cron: "0 9 * * 1"
workflow_dispatch:
jobs:
health-check:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Build
run: go build -o awesome-docker ./cmd/awesome-docker
- name: Run Health Scoring
run: ./awesome-docker health
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Report
id: report
run: |
./awesome-docker report > health_report.txt 2>&1 || true
if [ -s health_report.txt ]; then
echo "has_report=true" >> "$GITHUB_OUTPUT"
else
echo "has_report=false" >> "$GITHUB_OUTPUT"
fi
- name: Create/Update Issue with Health Report
if: steps.report.outputs.has_report == 'true'
uses: actions/github-script@v7
with:
script: |
const fs = require('fs');
const report = fs.readFileSync('health_report.txt', 'utf8');
const issueBody = report + '\n\n---\n*Auto-generated weekly by health_report.yml*';
const issues = await github.rest.issues.listForRepo({
owner: context.repo.owner,
repo: context.repo.repo,
state: 'open',
labels: 'health-report',
per_page: 1
});
if (issues.data.length > 0) {
await github.rest.issues.update({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issues.data[0].number,
body: issueBody
});
} else {
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: 'Weekly Health Report - Repository Maintenance Needed',
body: issueBody,
labels: ['health-report', 'maintenance']
});
}