Skip to content

Commit 0a2269a

Browse files
authored
Merge pull request #8071 from segmentio/master
`master` into `develop` after GitHub Action PR
2 parents d8d62b0 + a99945b commit 0a2269a

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: New Files Report
2+
on:
3+
schedule:
4+
- cron: '0 16 * * 5' # This will run automatically every Friday at noon Eastern
5+
workflow_dispatch: # We can also trigger it manually from the Actions tab
6+
7+
jobs:
8+
report:
9+
if: github.repository == 'segmentio/segment-docs'
10+
runs-on: ubuntu-latest
11+
permissions:
12+
issues: write
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Generate report
20+
id: report
21+
run: |
22+
echo "## New files since July 20th, 2025" > report.md
23+
echo "" >> report.md
24+
25+
FILES=$(git log --since="2025-07-20" --diff-filter=A --name-only --pretty=format:"" -- src/ 2>/dev/null | grep -v '^$' | sort -u || echo "")
26+
27+
if [ -z "$FILES" ]; then
28+
echo "No new files found." >> report.md
29+
else
30+
echo "$FILES" | while read file; do
31+
if [ -n "$file" ]; then
32+
COMMIT=$(git log --diff-filter=A --format="%h" -- "$file" | head -1)
33+
DATE=$(git log --diff-filter=A --format="%ad" --date=short -- "$file" | head -1)
34+
MSG=$(git log --diff-filter=A --format="%s" -- "$file" | head -1)
35+
echo "- **$DATE**: \`$file\` - $MSG ([${COMMIT}](../../commit/${COMMIT}))" >> report.md
36+
fi
37+
done
38+
fi
39+
40+
echo "" >> report.md
41+
echo "_Report generated on $(date +'%Y-%m-%d %H:%M UTC')_" >> report.md
42+
43+
- name: Create issue
44+
uses: actions/github-script@v7
45+
with:
46+
script: |
47+
const fs = require('fs');
48+
const report = fs.readFileSync('report.md', 'utf8');
49+
const today = new Date().toISOString().split('T')[0];
50+
51+
github.rest.issues.create({
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
title: `New files report - ${today}`,
55+
body: report,
56+
labels: ['migration'],
57+
assignees: ['pwseg']
58+
});

0 commit comments

Comments
 (0)