-
-
Notifications
You must be signed in to change notification settings - Fork 7
53 lines (49 loc) · 1.96 KB
/
labeller-file-based.yaml
File metadata and controls
53 lines (49 loc) · 1.96 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
---
name: Labeller (file-based)
"on":
workflow_call:
inputs:
extra-rules:
description: 'YAML describing the additional labelling rules respecting the actions/labeler dialect'
required: false
type: string
pull_request:
concurrency:
# Group workflow jobs so new commits cancels in-progress execution triggered by previous commits. Source:
# https://mail.python.org/archives/list/pypa-committers@python.org/thread/PCBCQMJF64JGRBOX7E2EE4YLKHT4DI55/
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/control-the-concurrency-of-workflows-and-jobs
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
jobs:
labeller:
name: File-based PR labeller
# Skip labelling:
# 1. On prepare-release branch as it points to a tagged URL that does not exist yet.
# 2. If PR was created/triggered by a bot. That way we can prevent content-rich PRs (like those produced by
# dependabot) to be overly tagged with extra labels.
if: >
github.head_ref != 'prepare-release'
&& github.event.sender.type != 'Bot'
&& github.actor != 'dependabot[bot]'
&& github.actor != 'dependabot-preview[bot]'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6.0.0
- name: Download default rules
run: >
curl -fsSL --output ./.github/labeller-file-based.yaml
https://raw.githubusercontent.com/kdeldycke/workflows/main/.github/labeller-file-based.yaml
- name: Extend default rules
if: inputs.extra-rules
run: |
tee -a ./.github/labeller-file-based.yaml <<-EOF
${{ inputs.extra-rules }}
EOF
- name: Print all rules
run: |
cat ./.github/labeller-file-based.yaml
- name: Apply rules
uses: actions/labeler@v6.0.1
with:
configuration-path: ".github/labeller-file-based.yaml"
sync-labels: true