https://github.com/maxisam/path-labeler
Github Action for creating label based on path
https://github.com/maxisam/path-labeler
Last synced: about 1 month ago
JSON representation
Github Action for creating label based on path
- Host: GitHub
- URL: https://github.com/maxisam/path-labeler
- Owner: maxisam
- License: mit
- Created: 2022-11-11T17:24:00.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-01T12:02:37.000Z (over 2 years ago)
- Last Synced: 2026-06-22T17:04:46.295Z (about 2 months ago)
- Language: TypeScript
- Size: 835 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
[](https://github.com/maxisam/path-labeler/actions/workflows/CI.yml)
# Path Labeler
**This is deprecated. Use https://github.com/maxisam/changed-files-labeler instead.**
Create labels based on the path of the changed files.
This is very helpful for monorepo projects.
1. when you want to label PRs based on the changed files.
2. when you want to trigger actions based on the changed files' path.
This action is heavily inspired by https://github.com/TinkurLab/monorepo-pr-labeler-action
It is for the case like
a file changed at `base/foo/bar/cat.ts`
and you want to create labels like `prefix1:foo` and `prefix2:bar` with the output like `base/foo/bar` and a list of added labels.
It allows you to define how many layers of the path you want to use to create labels.
## Usage
```yaml
labeler:
name: Labeler
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: maxisam/path-labeler@main
with:
authToken: ${{ secrets.GITHUB_TOKEN }}
basePaths: 'base1|base2'
prefixes: 'prefix1|prefix2'
delimiter: ':'
layers: 2
```
## Inputs
READ [Action YAML](.\action.yml)