security: tighten permissions and add debug step

- Change issues permission from write to read (least privilege)
- Add debug step to show generated metrics files before parsing
- Helps troubleshoot empty/missing files without failing the job
- Updated file list to match current pr_created_metrics.md structure
This commit is contained in:
Ralph Khreish
2025-09-22 15:41:57 +02:00
parent cd2da6a1ec
commit d5db033fdc

View File

@@ -8,7 +8,7 @@ on:
permissions:
contents: read
issues: write
issues: read
pull-requests: read
jobs:
@@ -60,6 +60,20 @@ jobs:
SEARCH_QUERY: "repo:${{ github.repository }} is:pr is:merged merged:${{ env.first_day }}..${{ env.last_day }}"
OUTPUT_FILE: pr_merged_metrics.md
- name: Debug generated metrics
run: |
set -Eeuo pipefail
echo "Listing markdown files in workspace:"
ls -la *.md || true
for f in issue_metrics.md pr_created_metrics.md pr_merged_metrics.md; do
if [ -f "$f" ]; then
echo "== $f (first 10 lines) =="
head -n 10 "$f"
else
echo "Missing $f"
fi
done
- name: Parse metrics
id: metrics
run: node .github/scripts/parse-metrics.mjs