-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (38 loc) · 1.19 KB
/
ci_bot_pr_changes.yml
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
name: CI - Update [bot] PR
on:
pull_request:
types: [opened, reopened]
branches:
- 'main'
jobs:
add_skip-changelog_label:
name: Add 'skip-changelog' label
runs-on: ubuntu-latest
if: github.event.pull_request.user.type == 'Bot'
permissions:
contents: read
issues: write
pull-requests: write
steps:
- name: Add 'skip-changelog' label
uses: actions/github-script@v7
with:
script: |
const labels = await github.rest.issues.listLabelsOnIssue({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number
})
for (const label of labels.data) {
if (label.name === 'skip-changelog') {
console.log("Label 'skip-changelog' already exists 👌")
return // Skip adding the label if it already exists
}
}
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['skip-changelog']
})
console.log("Label 'skip-changelog' added 🎉")