Skip to content

Labelling pull request with module tags based on changed files in the PR #7936

Labelling pull request with module tags based on changed files in the PR

Labelling pull request with module tags based on changed files in the PR #7936

# This file defines the workflow for labeling pull requests with module tags based on the changed files in the PR.

Check warning on line 1 in .github/workflows/label-pull-request.yml

View workflow run for this annotation

GitHub Actions / Pull Request Labeler

Workflow execution policy warning (evaluate mode)

On December 2, 2026, GitHub will restrict `pull_request_target` on public repositories by default. To continue allowing the event trigger, configure an Actions policy. Learn more: https://gh.io/securely-using-pull_request_target#default-policy-for-pull_request_target
# It uses the `actions/labeler` GitHub Action to achieve the same.
#
# The workflow is triggered on the `pull_request_target` event which ensures workflow is only run from the master branch.
# The job `labeler` has permissions to read contents and write pull requests.
#
# For more information on the `actions/labeler` GitHub Action, refer to https://github.com/actions/labeler
name: "Pull Request Labeler"
run-name: Labelling pull request with module tags based on changed files in the PR
on:
# see labeler docs for explanation
# zizmor: ignore[dangerous-triggers]
- pull_request_target
permissions: {}
# don't need to concurrently label same PR
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
jobs:
labeler:
name: Label PRs
# only run on the main Lucene repository.
if: (github.repository == 'apache/lucene')
permissions:
contents: read # likely not needed for public repository
pull-requests: write # manipulate existing labels
runs-on: ubuntu-slim
timeout-minutes: 15
steps:
- name: Run Labeler action
uses: actions/labeler@bf12e9b00b37c5c0ca2b87b79b2daf7891dbda13 # v7.0.0
with:
sync-labels: true