Skip to content

SCL339/pr-labeler-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PR Labeler Action 🏷️

GitHub Release GitHub Marketplace MIT License PRs Welcome


  • Smart deduplication — Won't add labels that already exist on the PR
  • CI/CD ready — Works on pull_request and pull_request_target events
  • Lightweight — Pure Python, no Docker image to pull
  • JSON support — Can also use .json config format

  • 'src/styles/**'
  • 'src/pages/**'

backend:

  • 'src/api/**'
  • 'src/models/**'
  • 'src/services/**'

documentation:

  • 'docs/**'
  • '*.md'
  • '**/*.md'

dependencies:

  • 'package.json'
  • 'package-lock.json'
  • 'requirements.txt'
  • '**/go.mod'

infrastructure:

  • 'Dockerfile'
  • 'docker-compose.yml'
  • '.github/**'
  • 'k8s/**'

---

types: [opened, synchronize, reopened]

permissions:
contents: read
pull-requests: write

jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: SCL339/pr-labeler-action@v1.0.0
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

|-------|-------------|----------|---------| | github-token | GitHub token with label write access | No | ${{ github.token }} | | config-path | Path to label config file in the repo | No | .github/pr-labeler.yml | | fail-on-missing-config | Fail if config file is missing | No | false |


  • 'another/pattern/**'

---

{
"frontend": ["src/components/**", "src/styles/**"],
"backend": ["src/api/**", "src/models/**"]
}

| ** | Any sequence of characters (including /) | | ? | Any single character (except /) | | [abc] | Any character in the set |


tests:

  • 'tests/**' # Any file under tests/
  • '**/test_*.py' # Any test Python file anywhere
  • 'src//tests/' # Nested test directories

python:

  • '**/*.py' # Any Python file anywhere

config:

  • '*.yml' # YAML files in root
  • 'config/**' # Everything under config/
  • '.env*' # .env, .env.example, etc.

---

on: [pull_request]
permissions:
contents: read
pull-requests: write
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: SCL339/pr-labeler-action@v1.0.0

  • uses: SCL339/pr-labeler-action@v1.0.0 with: github-token: ${{ secrets.GITHUB_TOKEN }} config-path: .github/label-config.yml fail-on-missing-config: 'true'

---

on:
pull_request_target:
types: [opened, synchronize, reopened]
jobs:
label:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- uses: SCL339/pr-labeler-action@v1.0.0

m/SCL339/pr-labeler-action.git cd pr-labeler-action

Test locally with a mock event:

python3 entrypoint.py


---

- 🚀 **Deploy your frontend** on [Vercel](https://vercel.com/?utm_source=scl339&utm_campaign=oss)
- ⭐ **Star this repo** to help others discover it

---

---

## 🤝 赞助支持 (Sponsor)

如果这个项目对你有帮助,可以请我喝杯咖啡 ☕

- 💖 **支付宝 (Alipay)**: `18559219554` | 邮箱联系: `530765059@qq.com`
- ☁️ **DigitalOcean 联盟链接**: [免费 $200 额度](https://m.do.co/c/2ca0db2b48be)
- ⭐ **在 GitHub 上点 Star** 帮助更多人发现这个项目

## 📄 License

About

A GitHub Action that automatically adds labels to pull requests based on changed file paths. Configurable path-to-label mapping with glob patterns.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages