1
+ name : Labeler
2
+
3
+ on :
4
+ pull_request :
5
+ # opened, reopened, and synchronize are default for pull_request
6
+ # edited - when PR title or body is changed
7
+ # labeled - when labels are added to PR
8
+ types : [opened, reopened, synchronize, edited, labeled]
9
+ push :
10
+ branches : [ main ]
11
+ paths :
12
+ - ' ../labels.yml'
13
+
14
+ concurrency :
15
+ group : ${{ github.workflow }}-${{ github.ref }}
16
+ cancel-in-progress : true
17
+
18
+ jobs :
19
+ label-syncer :
20
+ name : Syncer
21
+ runs-on : ubuntu-latest
22
+ steps :
23
+ - uses : actions/checkout@v4
24
+ - uses : micnncim/action-label-syncer@v1
25
+ env :
26
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
27
+
28
+ labeler :
29
+ name : Set labels
30
+ needs : [label-syncer]
31
+ permissions :
32
+ contents : read
33
+ pull-requests : write
34
+ runs-on : ubuntu-latest
35
+ steps :
36
+ # Label based on modified files
37
+ - name : Label based on changed files
38
+ uses : actions/labeler@v5
39
+ with :
40
+ repo-token : ${{ secrets.GITHUB_TOKEN }}
41
+ sync-labels : true
42
+
43
+ - uses : actions-ecosystem/action-add-labels@v1
44
+ if : |
45
+ startsWith(github.event.pull_request.head.ref, 'doc') ||
46
+ startsWith(github.event.pull_request.head.ref, 'docs')
47
+ with :
48
+ labels : documentation
49
+ - uses : actions-ecosystem/action-add-labels@v1
50
+ if : |
51
+ startsWith(github.event.pull_request.head.ref, 'maint') ||
52
+ startsWith(github.event.pull_request.head.ref, 'no-ci') ||
53
+ startsWith(github.event.pull_request.head.ref, 'ci')
54
+ with :
55
+ labels : maintenance
56
+
57
+ - uses : actions-ecosystem/action-add-labels@v1
58
+ if : startsWith(github.event.pull_request.head.ref, 'feat')
59
+ with :
60
+ labels : enhancement
61
+
62
+ - uses : actions-ecosystem/action-add-labels@v1
63
+ if : |
64
+ startsWith(github.event.pull_request.head.ref, 'fix') ||
65
+ startsWith(github.event.pull_request.head.ref, 'patch')
66
+ with :
67
+ labels : bug
68
+
69
+ commenter :
70
+ runs-on : ubuntu-latest
71
+ steps :
72
+ - name : Suggest to add labels
73
+ uses : peter-evans/create-or-update-comment@v4
74
+ # Execute only when no labels have been applied to the pull request
75
+ if : toJSON(github.event.pull_request.labels.*.name) == '{}'
76
+ with :
77
+ issue-number : ${{ github.event.pull_request.number }}
78
+ body : |
79
+ Please add one of the following labels to add this contribution to the Release Notes :point_down:
80
+ - [bug](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Abug+)
81
+ - [documentation](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Adocumentation+)
82
+ - [enhancement](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Aenhancement+)
83
+ - [good first issue](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Agood+first+issue)
84
+ - [maintenance](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Amaintenance+)
85
+ - [release](https://github.com/ansys/ansys-tools-visualization-interface/pulls?q=label%3Arelease+)
86
+
87
+ changelog-fragment :
88
+ name : " Create changelog fragment"
89
+ needs : [labeler]
90
+ permissions :
91
+ contents : write
92
+ pull-requests : write
93
+ runs-on : ubuntu-latest
94
+ steps :
95
+ - uses : ansys/actions/doc-changelog@v6
96
+ with :
97
+ token : ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
0 commit comments