Skip to content

Commit e05b37c

Browse files
authored
Merge pull request #966 from brendandburns/examples
Fix push script to be able to run without input and skip tagging.
2 parents 22e0b76 + f2a0219 commit e05b37c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ jobs:
2222
run: ./push-package.sh
2323
env:
2424
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
confirm: "y"
26+
SKIP_TAG: "y"

push-package.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ version=$(cat package.json | jq -r .version)
88
. ./pre-check.sh
99

1010
echo "This will tag and publish package version ${version}"
11-
read -p "Confirm [y/N]" confirm
11+
if [[ -z "$confirm" ]]; then
12+
read -p "Confirm [y/N]" confirm
13+
fi
1214

1315
case "${confirm}" in
1416
y|Y ) echo "Tagging and pushing ${version}";;
1517
* ) echo "Aborting"; exit 0;;
1618
esac
1719

18-
git tag ${version}
19-
git push upstream ${version}
20+
if [[ -z "$SKIP_TAG" ]]; then
21+
git tag ${version}
22+
git push upstream ${version}
23+
fi
2024

2125
npm publish
2226
npm version patch -m "Update to version ${version}"

0 commit comments

Comments
 (0)