-
Notifications
You must be signed in to change notification settings - Fork 180
36 lines (31 loc) · 1.24 KB
/
check-changelog.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
# Checks if a file has been committed under the .changes/unreleased directory
#
# Skip PRs labeled with 'dependencies'
on:
pull_request:
branches:
- main
- pre-release
name: Check if changelog entry exists
jobs:
changelog_existence:
name: Check if changelog entry exists
if: "!contains(github.event.pull_request.labels.*.name, 'dependencies')"
runs-on: ubuntu-latest
steps:
- name: Check if changelog file was added
# https://github.com/marketplace/actions/paths-changes-filter
# For each filter, it sets output variable named by the filter to the text:
# 'true' - if any of changed files matches any of filter rules
# 'false' - if none of changed files matches any of filter rules
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changelog_check
with:
filters: |
exists:
- '.changes/unreleased/**.yaml'
- name: Fail job if changelog entry is missing and required
if: steps.changelog_check.outputs.exists == 'false'
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: core.setFailed('Changelog entry required to merge.')