-
Notifications
You must be signed in to change notification settings - Fork 69
59 lines (52 loc) · 1.65 KB
/
changelog.yaml
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
# Changelog
#
# Validates that a changelog entry was added.
# Runs on PRs when:
# - opened/re-opened
# - new commits pushed
# - label is added or removed
# Runs on merge queues, but just passes, because it is a required check.
name: Changelog
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
# Due to merge queue requiring same status checks as PRs, must pass by default
merge_group:
types: [checks_requested]
jobs:
validate-changelog:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
env:
PR_HAS_LABEL: ${{ contains( github.event.pull_request.labels.*.name, 'no-changelog') }}
steps:
# checkout full depth because in the check_changelog_fragments script, we need to specify a
# merge base. If we only shallow clone the repo, git may not have enough history to determine
# the base.
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: |
if [[ $PR_HAS_LABEL == 'true' ]] ; then
echo "'no-changelog' label detected."
exit 0
fi
# helper script needs to reference the master branch to compare against
git fetch origin main:refs/remotes/origin/main
./scripts/check_changelog_fragments.sh
check-changelog:
name: Changelog
runs-on: ubuntu-latest
needs: validate-changelog
if: always()
env:
FAILED: ${{ contains(needs.*.result, 'failure') }}
steps:
- name: exit
run: |
echo "failed=${{ env.FAILED }}"
if [[ "$FAILED" == "true" ]] ; then
exit 1
else
exit 0
fi