Skip to content

Commit

Permalink
ci: Add GitHub Action to begin auto-labeling Pull Requests (#469)
Browse files Browse the repository at this point in the history
This PR is designed to add rules that will auto-label PRs editing
certain files defined in `labeler.yml`

Goal is to make it easier for maintainers to sort through Pull Requests,
can be further enhanced/refined by adding new labels and files to the
config

You can read more about this action here:
https://github.com/actions/labeler

---------

Signed-off-by: Nathan Weinberg <nweinber@redhat.com>
Signed-off-by: BJ Hargrave <hargrave@us.ibm.com>
Co-authored-by: BJ Hargrave <hargrave@us.ibm.com>
  • Loading branch information
nathan-weinberg and bjhargrave authored Mar 23, 2024
1 parent a53e4bc commit 5041065
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright The InstructLab Authors, 2024
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ci:
- changed-files:
- any-glob-to-any-file:
- .github/scripts/**
- .github/workflows/**
- .github/*.yml

documentation:
- changed-files:
- any-glob-to-any-file:
- "*.md"
- docs/**

knowledge:
- changed-files:
- any-glob-to-any-file:
- knowledge/**

skill:
- changed-files:
- any-glob-to-any-file:
- compositional_skills/**

triage-needed:
- changed-files:
- any-glob-to-any-file:
- compositional_skills/**
- knowledge/**
30 changes: 30 additions & 0 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright The InstructLab Authors, 2024
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

name: "Pull Request Labeler"

on:
- pull_request_target

jobs:
labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
sync-labels: true

0 comments on commit 5041065

Please sign in to comment.