Skip to content

Commit

Permalink
ci: Add PR labeler workflow and configuration (#24)
Browse files Browse the repository at this point in the history
# Pull Request

## Description

This change introduces an automated labelling system for pull requests using GitHub Actions. The key additions are:

1. A new `labeller.yml` file in the `.github/other-configurations/` directory, which defines rules for automatically assigning labels to pull requests based on file changes and branch names.

2. An update to the `pull-request-checks.yml` workflow file, adding a new job called `labeller` that uses the `actions/labeler@v5` action to apply the labelling rules.

The labelling rules cover various categories such as documentation, dependencies, Python code, Just files, shell scripts, GitHub Actions, analyser, and git hooks. This automation will help streamline the pull request process by automatically categorising changes, making it easier for reviewers to identify the nature of the modifications.

fixes #8
  • Loading branch information
JackPlowman authored Sep 27, 2024
1 parent 3f12d38 commit c03cbbc
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/other-configurations/labeller.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# labels auto assigned to PR, keep in sync with labels.yml
documentation:
- any:
- changed-files:
- any-glob-to-any-file: ["README.md", "docs/**"]
dependencies:
- any:
- changed-files:
- any-glob-to-any-file: ["**/poetry.lock", "package-lock.json"]
- head-branch: ["^dependabot"]
python:
- any:
- changed-files:
- any-glob-to-any-file: ["*.py", "**/*.py"]
just:
- any:
- changed-files:
- any-glob-to-any-file: ["Justfile", "**/*.just"]
shell:
- any:
- changed-files:
- any-glob-to-any-file: ["**/*.sh"]
github_actions:
- any:
- changed-files:
- any-glob-to-any-file:
[".github/workflows/*", ".github/workflows/**/*"]
analyser:
- any:
- changed-files:
- any-glob-to-any-file: ["analyser/**"]
git_hooks:
- any:
- changed-files:
- any-glob-to-any-file: ["githooks/**"]
8 changes: 8 additions & 0 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,11 @@ jobs:
uses: deepakputhraya/[email protected]
with:
allowed_prefixes: "feat: ,fix: ,bug: ,ci: ,refactor: ,docs: ,build: ,chore(,deps(,chore: ,feat!: ,fix!: ,refactor!: ,test: " # title should start with the given prefix
labeller:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
configuration-path: .github/other-configurations/labeller.yml
sync-labels: true

0 comments on commit c03cbbc

Please sign in to comment.