Skip to content

Commit 3f4b4f3

Browse files
committed
scripts+.github: add release notes updated check
1 parent 8b04135 commit 3f4b4f3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/main.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,3 +243,17 @@ jobs:
243243

244244
- name: run check
245245
run: make itest
246+
247+
########################
248+
# check PR updates release notes
249+
########################
250+
release-notes-check:
251+
name: check release notes updated
252+
runs-on: ubuntu-latest
253+
if: '!contains(github.event.pull_request.labels.*.name, ''no-changelog'')'
254+
steps:
255+
- name: git checkout
256+
uses: actions/checkout@v3
257+
258+
- name: release notes check
259+
run: scripts/check-release-notes.sh

scripts/check-release-notes.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Extract the PR number which is stored in the $GITHUB_REF env variable. The
6+
# format of the string stored in the variable is: refs/pull/:PRNUMBER/merge.
7+
PR_NUMBER=$(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
8+
9+
# If this is a PR being merged into the main repo, then the PR number will
10+
# actually be "master" here, so we'll ignore this case, and assume that in
11+
# order for it to be merged it had to pass the check in its base branch. If
12+
# we're trying to merge this with the Merge Queue, then the PR number will be
13+
# "gh-readonly-queue" instead.
14+
if [[ $PR_NUMBER == "master" ]] || [[ $PR_NUMBER == "gh-readonly-queue" ]]; then
15+
exit 0
16+
fi
17+
18+
# Ensure that the PR number at least shows up in the release notes folder under
19+
# one of the contained milestones.
20+
if ! grep -r -q "lightninglabs/lightning-terminal/pull/$PR_NUMBER" doc/release-notes; then
21+
echo "PR $PR_NUMBER didn't update release notes"
22+
exit 1
23+
fi

0 commit comments

Comments
 (0)