nuttx-apps/.github/labeler.yml
Lup Yuen Lee fe546acfc7 github/workflow: Sync the new PR Labeling Workflow from NuttX Repo to NuttX Apps
This PR replicates the new PR Labeling Workflow from NuttX Repo to NuttX Apps Repo. For Future Syncing:
- Copy from NuttX Repo to NuttX Apps: `.github/workflows/labeler.yml` and `.github/workflows/pr_labeler.yml`
- Edit `.github/workflows/labeler.yml` and change `repository: apache/nuttx` to `repository: apache/nuttx-apps`
- Don't overwrite `.github/labeler.yml` by NuttX Repo

The new workflow reimplements PR Labeling with two triggers: pull_request and workflow_run. We no longer need pull_request_target, which is an unsafe trigger and may introduce security vulnerabilities.

The New PR Labeler is explained here:
- https://lupyuen.org/articles/prtarget
- https://github.com/apache/nuttx/issues/18359

Modified Files:

`.github/workflows/labeler.yml`: Changed the (read-write) pull_request_target trigger to (read-only) pull_request trigger. Compute the Size Label (e.g. Size: XS) and Arch Labels (e.g. Area: Examples). Save the PR Labels into a PR Artifact.

`.github/labeler.yml`: Added comment to clarify that NuttX PR Labeler only supports a subset of the `actions/labeler` syntax: `changed-files` and `any-glob-to-any-file`. Note: Don't overwrite this file by NuttX Repo.

New Files:

`.github/workflows/pr_labeler.yml`: Contains the workflow_run trigger, which is executed upon completion of the pull_request trigger. Download the PR Labels from the PR Artifact. Write the PR Labels into the PR.

Signed-off-by: Lup Yuen Lee <luppy@appkaki.com>
2026-02-23 20:33:22 +08:00

171 lines
4.7 KiB
YAML

# SPDX-License-Identifier: Apache-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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.
#
# Note: NuttX PR Labeler only supports a subset of the
# `actions/labeler` syntax: `changed-files` and
# `any-glob-to-any-file`. See .github/workflows/labeler.yml
# add arch labels
"Area: Audio":
- changed-files:
- any-glob-to-any-file: 'audioutils/**'
- any-glob-to-any-file: 'include/audioutils/**'
"Area: Benchmarks":
- changed-files:
- any-glob-to-any-file: 'benchmarks/**'
- any-glob-to-any-file: 'include/benchmarks/**'
"Area: Boot":
- changed-files:
- any-glob-to-any-file: 'boot/**'
- any-glob-to-any-file: 'include/boot/**'
"Area: CAN":
- changed-files:
- any-glob-to-any-file: 'canutils/**'
- any-glob-to-any-file: 'include/canutils/**'
"Area: Binfmt":
- changed-files:
- any-glob-to-any-file: 'builtin/**'
- any-glob-to-any-file: 'include/builtin/**'
"Area: Crypto":
- changed-files:
- any-glob-to-any-file: 'crypto/**'
- any-glob-to-any-file: 'include/crypto/**'
"Area: Database":
- changed-files:
- any-glob-to-any-file: 'database/**'
- any-glob-to-any-file: 'include/database/**'
"Area: Examples":
- changed-files:
- any-glob-to-any-file: 'examples/**'
"Area: File System":
- changed-files:
- any-glob-to-any-file: 'fsutils/**'
- any-glob-to-any-file: 'include/fsutils/**'
"Area: Games":
- changed-files:
- any-glob-to-any-file: 'games/**'
- any-glob-to-any-file: 'include/games/**'
"Area: Graphics":
- changed-files:
- any-glob-to-any-file: 'graphics/**'
- any-glob-to-any-file: 'include/graphics/**'
"Area: Industry":
- changed-files:
- any-glob-to-any-file: 'industry/**'
- any-glob-to-any-file: 'include/industry/**'
"Area: Inertial":
- changed-files:
- any-glob-to-any-file: 'inertial/**'
- any-glob-to-any-file: 'include/inertial/**'
"Area: Interpreters":
- changed-files:
- any-glob-to-any-file: 'interpreters/**'
- any-glob-to-any-file: 'include/interpreters/**'
"Area: Logging":
- changed-files:
- any-glob-to-any-file: 'logging/**'
- any-glob-to-any-file: 'include/logging/**'
"Area: LTE":
- changed-files:
- any-glob-to-any-file: 'lte/**'
- any-glob-to-any-file: 'include/lte/**'
"Area: Math":
- changed-files:
- any-glob-to-any-file: 'math/**'
- any-glob-to-any-file: 'include/math/**'
"Area: Mlearning":
- changed-files:
- any-glob-to-any-file: 'mlearning/**'
- any-glob-to-any-file: 'include/mlearning/**'
"Area: Modbus":
- changed-files:
- any-glob-to-any-file: 'modbus/**'
- any-glob-to-any-file: 'include/modbus/**'
"Area: Networking":
- changed-files:
- any-glob-to-any-file: 'netutils/**'
- any-glob-to-any-file: 'include/netuitls/**'
"Area: NSH":
- changed-files:
- any-glob-to-any-file: 'nshlib/**'
- any-glob-to-any-file: 'include/nshlib/**'
"Area: SDR":
- changed-files:
- any-glob-to-any-file: 'sdr/**'
- any-glob-to-any-file: 'include/sdr/**'
"Area: System":
- changed-files:
- any-glob-to-any-file: 'system/**'
- any-glob-to-any-file: 'include/system/**'
"Area: Testing":
- changed-files:
- any-glob-to-any-file: 'testing/**'
- any-glob-to-any-file: 'include/testing/**'
"Area: Video":
- changed-files:
- any-glob-to-any-file: 'videotuils/**'
- any-glob-to-any-file: 'include/videotuils/**'
"Area: Wireless":
- changed-files:
- any-glob-to-any-file: 'wireless/**'
- any-glob-to-any-file: 'include/wireless/**'
"Area: Build system":
- changed-files:
- any-glob-to-any-file: 'Makefile'
- any-glob-to-any-file: 'Make.defs'
- any-glob-to-any-file: '*.mk'
- any-glob-to-any-file: 'CMakeLists.txt'
- any-glob-to-any-file: 'cmake/**'
- any-glob-to-any-file: 'import/**'
- any-glob-to-any-file: 'staging/**'
"Area: Tools":
- changed-files:
- any-glob-to-any-file: 'tools/**'
"Area: CI":
- changed-files:
- any-glob-to-any-file: '.github/**'