Skip to content

Commit bb704e2

Browse files
committed
Add a script for copying the docs and schema over for release
This needs to be run immediately before creating a release. We could go further here and use gh to create the PR, but since I'm usually logged in with my work account to gh, this won't help me. The git push command prints the URL to create the PR, so it's a simple matter of command-clicking it, which is good enough for me.
1 parent 48806eb commit bb704e2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

scripts/update_docs_for_release.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
set -euo pipefail
4+
5+
st=$(git status --porcelain)
6+
if [ -n "$st" ]; then
7+
echo "Working directory is not clean; aborting."
8+
exit 1
9+
fi
10+
11+
if diff -r -q docs docs-master > /dev/null && diff -r -q schema schema-master > /dev/null; then
12+
echo "No changes to docs or schema; nothing to do."
13+
exit 0
14+
fi
15+
16+
branch_name=update-docs-for-release
17+
18+
if git show-ref --verify --quiet refs/heads/"$branch_name"; then
19+
echo "Branch '$branch_name' already exists; aborting."
20+
exit 1
21+
fi
22+
23+
git checkout -b "$branch_name" --no-track origin/master
24+
25+
git rm -r docs schema
26+
cp -r docs-master docs
27+
cp -r schema-master schema
28+
git add docs schema
29+
git commit -m "Update docs and schema for release"
30+
31+
git push -u origin "$branch_name"

0 commit comments

Comments
 (0)