Skip to content

Commit 9fa3c32

Browse files
committed
Add --provenance flag to npm publish when running in GitHub Actions
1 parent a4798c9 commit 9fa3c32

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

scripts/npm-publish.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ npm_publish_with_retry() {
6565
local delay=5
6666

6767
for attempt in $(seq 1 "$max_attempts"); do
68-
if (cd "$pkg_dir" && npm publish --tag "$tag"); then
68+
local provenance_flag=""
69+
[ "${GITHUB_ACTIONS:-false}" = "true" ] && provenance_flag="--provenance"
70+
if (cd "$pkg_dir" && npm publish --tag "$tag" $provenance_flag); then
6971
return 0
7072
fi
7173
if [ "$attempt" -lt "$max_attempts" ]; then

0 commit comments

Comments
 (0)