Files
blackroad-os-demo/.github/workflows/pr-labeler.yml
Alexa Louise 7f3c7db537 Add GitHub Actions automations
- Security scanning (CodeQL, dependency review, secrets)
- Railway auto-deploy on push to main
- Release automation with Docker image publishing
- Health check monitoring
- PR labeler and Dependabot

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-30 10:25:28 -06:00

66 lines
2.1 KiB
YAML

name: PR Labeler
on:
pull_request:
types: [opened, edited, synchronize]
permissions:
contents: read
pull-requests: write
jobs:
label:
name: Label PR
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Label based on files changed
uses: actions/labeler@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/labeler.yml
- name: Label based on PR size
uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
xs_label: 'size/xs'
xs_max_size: 10
s_label: 'size/s'
s_max_size: 100
m_label: 'size/m'
m_max_size: 500
l_label: 'size/l'
l_max_size: 1000
xl_label: 'size/xl'
fail_if_xl: false
- name: Label based on title
uses: actions/github-script@v7
with:
script: |
const title = context.payload.pull_request.title.toLowerCase();
const labels = [];
if (title.includes('fix') || title.includes('bug')) labels.push('bug');
if (title.includes('feat') || title.includes('feature')) labels.push('enhancement');
if (title.includes('docs') || title.includes('documentation')) labels.push('documentation');
if (title.includes('refactor')) labels.push('refactor');
if (title.includes('test')) labels.push('testing');
if (title.includes('ci') || title.includes('workflow')) labels.push('ci/cd');
if (title.includes('security')) labels.push('security');
if (title.includes('breaking')) labels.push('breaking-change');
if (title.includes('wip') || title.includes('draft')) labels.push('work-in-progress');
if (labels.length > 0) {
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.payload.pull_request.number,
labels: labels
});
}