Sitemap
Kirti K

Kirti K

Kind is cool & share your knowledge 👋 👋 A seasoned front-end developer with over 15 years of experience crafting immersive digital experiences.

Member-only story

Day 5 — PR Automation: Auto-Labels, Size Checks, and Statistics

3 min readJun 8, 2026

Reviewing pull requests is easier when you can see at a glance what changed and how large the PR is.

Day 5 automates three things

labelling PRs based on which files changed,

adding a size label, and

posting a statistics comment.

Press enter or click to view image in full size

WorkFlow

Three separate jobs running in parallel on every PR.

Job 1 — Auto-label by file type

```yaml
- name: Label based on files changed
uses: actions/github-script@v7
with:
script: |
const { data: files } = await github.rest.pulls.listFiles({...});
const labels = new Set();

for (const file of files) {
const path = file.filename;
if (path.includes('.github/workflows/')) labels.add('workflows');
if (path.startsWith('src/')) labels.add('source-code');
if (path.includes('.test.')) labels.add('tests');
if (path.endsWith('.md')) labels.add('documentation');
if (path === 'package.json') labels.add('dependencies');
if (path.endsWith('.css')) labels.add('styles');
if (path.includes('components/')) labels.add('components');
}

if…

--

--

Kirti K
Kirti K

Written by Kirti K

Kind is cool & share your knowledge 👋 👋 A seasoned front-end developer with over 15 years of experience crafting immersive digital experiences.