Skip to content

Commit 0c45477

Browse files
committed
chore(scripts): add optional work item var
1 parent 9e99ad3 commit 0c45477

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

scripts/release/publish.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
# Find the commit on master that last changed the root package.json version,
44
# then submit a PR to merge that commit onto the release branch and release via nucleus
5+
# Optionally set WORK_ITEM env var to include in commit/PR title
56
# Usage: yarn release:publish [branch=release]
7+
# Example: WORK_ITEM=W-1234567 yarn release:publish
68

79
set -e
810

@@ -29,8 +31,12 @@ git switch -c "$BRANCH" "$VERSION_SHA"
2931
git push origin HEAD
3032

3133
if which gh >/dev/null; then
34+
PR_TITLE="chore: release $VERSION"
35+
if [ -n "$WORK_ITEM" ]; then
36+
PR_TITLE+=" @$WORK_ITEM"
37+
fi
3238
# Use GitHub CLI to create a PR and wait for CI checks to pass
33-
gh pr create -t "chore: release $VERSION" -B "$RELEASE_BRANCH" -b ''
39+
gh pr create -t -B "$RELEASE_BRANCH" -b ''
3440
# Clean up locally
3541
git switch "$BASE_BRANCH"
3642
git branch -D "$BRANCH"

scripts/release/version.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
#!/usr/bin/env bash
22

33
# Bump package versions for release and submit a PR on GitHub
4+
# Optionally set WORK_ITEM env var to include in commit/PR title
45
# Usage: yarn release:version <version>
6+
# Example: WORK_ITEM=W-1234567 yarn release:version patch
57

68
set -e
79

@@ -28,6 +30,9 @@ node "$(dirname "$0")/version.js" "$VERSION"
2830
# Input could have been major/minor/patch; update the var to the resolved version
2931
VERSION=$(jq -r .version package.json)
3032
VERSION_BUMP_MESSAGE="chore: bump version to $VERSION"
33+
if [ -n "$WORK_ITEM" ]; then
34+
VERSION_BUMP_MESSAGE+=" @$WORK_ITEM"
35+
fi
3136
git commit -am "$VERSION_BUMP_MESSAGE"
3237
git push origin HEAD
3338

0 commit comments

Comments
 (0)