-
Notifications
You must be signed in to change notification settings - Fork 103
42 lines (38 loc) · 1.2 KB
/
housekeeping.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
# Checks that proper housekeeping has been performed on a PR.
name: Housekeeping
on:
pull_request:
branches:
- main
merge_group:
jobs:
versioning:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository@main
uses: actions/checkout@v4
with:
ref: main
path: __ref-main
- name: Check if package.json version was updated
run: |
this_version=$(jq -r '.version' package.json)
if [[ "$this_version" == "null" ]]; then
continue
fi
if [[ ! -f "__ref-main/package.json" ]]; then
main_version=""
else
main_version=$(jq -r '.version' __ref-main/package.json)
fi
if [[ "$main_version" == "$this_version" ]]; then
echo "::error:: package.json version ($main_version) was not updated"
exit 1
elif ! grep -q "^## $this_version" CHANGELOG.md; then
echo "::error:: CHANGELOG.md was not updated with latest version"
exit 1
else
echo "::notice:: package.json updated: $main_version => $this_version"
fi