-
-
Notifications
You must be signed in to change notification settings - Fork 278
Expand file tree
/
Copy pathcreateChangelog
More file actions
executable file
·28 lines (26 loc) · 706 Bytes
/
createChangelog
File metadata and controls
executable file
·28 lines (26 loc) · 706 Bytes
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
#! /bin/bash
#
# This tool creates a changelog file for the current branch.
# It uses the github cli to get the PR number.
#
if command -v gh > /dev/null ; then
PR="$(gh pr view --json number -q .number)"
if [ $? -eq 0 ]; then
FILE="`git rev-parse --show-toplevel`/docs/changelog/$PR.md"
if [ -f $FILE ]; then
echo "Changelog file for PR $PR already exists."
echo $FILE
exit 2
else
echo "Changelog file for PR $PR created."
echo $FILE
echo "- TODO" > $FILE
exit 0
fi
else
echo "Could not find a associated pull request. Make sure you created one."
fi
else
echo "Please install GitHub CLI first: https://cli.github.com/"
exit 1
fi