-
Notifications
You must be signed in to change notification settings - Fork 29
60 lines (54 loc) · 2.54 KB
/
Labeler.yml
File metadata and controls
60 lines (54 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This workflow automatically applies labels to issues and pull requests
# based on regular expression matches against the content in the issue
# or pull request or file path pattern matches.
#
# The labels are declaratively defined in the following configuration files:
# - File Path Patterns: .sync/workflows/config/label-issues/file-paths.yml
# - Regular Expressions for Pull Requests: .sync/workflows/config/label-issues/regex-pull-requests.yml
#
# These will be mapped to the following directories in repos that use this reusable workflow:
# - File Path Patterns: .github/workflows/label-issues/file-paths.yml
# - Regular Expressions for Pull Requests: .github/workflows/label-issues/regex-pull-requests.yml
#
# Ideally, curl (or wget) could be used to grab the files from mu_devops in this workflow file and once on
# the local runner, the file path could simply be passed to the actions. That is not currently possible as
# the actions are hardcoded to use the GitHub REST API to get the files in the local repo. If that is fixed
# (tracked in https://github.com/github/issue-labeler/issues/39) then that approach can be used.
#
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# For more information, see:
# https://github.com/actions/labeler
# https://github.com/github/issue-labeler
name: Apply Labels Based on Message Content
on:
workflow_call:
jobs:
sync:
name: Label Based on Messages
runs-on: ubuntu-latest
steps:
- name: Generate Token
id: app-token
uses: actions/create-github-app-token@v3
with:
app-id: ${{ vars.MU_ACCESS_APP_ID }}
private-key: ${{ secrets.MU_ACCESS_APP_PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
- name: Apply Labels Based on PR File Paths
uses: actions/labeler@v6.0.1
with:
configuration-path: .github/workflows/label-issues/file-paths.yml
repo-token: ${{ steps.app-token.outputs.token }}
sync-labels: true
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'
- name: Apply PR Labels Based on Policies
uses: srvaroa/labeler@v1.14.0
with:
config_path: .github/workflows/label-issues/regex-pull-requests.yml
use_local_config: false
fail_on_error: true
env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
if: github.event_name == 'pull_request' || github.event_name == 'pull_request_target'