diff --git a/.github/workflows/release-integration.yml b/.github/workflows/release-integration.yml index d986e4be..090ef8ca 100644 --- a/.github/workflows/release-integration.yml +++ b/.github/workflows/release-integration.yml @@ -58,17 +58,10 @@ jobs: run: | EXIT_CODE=0 - function each_release { - if npm publish --provenance --tag="$1"; then - echo 0 - else - echo 1 - fi - } - for release in $(echo $RELEASES | jq -r '.[] | @base64'); do PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag) - STATUS=$(each_release "$PUBLISH_TAG") + npm publish --provenance --tag="$PUBLISH_TAG" + STATUS=$? if [[ "$STATUS" -eq 1 ]]; then EXIT_CODE=$STATUS fi diff --git a/lib/content/_job-release-integration-yml.hbs b/lib/content/_job-release-integration-yml.hbs index 4596acdc..daeba3c2 100644 --- a/lib/content/_job-release-integration-yml.hbs +++ b/lib/content/_job-release-integration-yml.hbs @@ -23,22 +23,15 @@ steps: run: | EXIT_CODE=0 - function each_release { - if {{#if publish}}npm publish --provenance --tag="$1"{{else}}npm view "$@" --loglevel=error > /dev/null{{/if}}; then - echo 0 - else - echo 1 - fi - } - for release in $(echo $RELEASES | jq -r '.[] | @base64'); do {{#if publish}} PUBLISH_TAG=$(echo "$release" | base64 --decode | jq -r .publishTag) - STATUS=$(each_release "$PUBLISH_TAG") + npm publish --provenance --tag="$PUBLISH_TAG" {{else}} SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)" - STATUS=$(each_release "$SPEC") + npm view "$SPEC" --json {{/if}} + STATUS=$? if [[ "$STATUS" -eq 1 ]]; then EXIT_CODE=$STATUS {{#unless publish}} diff --git a/tap-snapshots/test/apply/source-snapshots.js.test.cjs b/tap-snapshots/test/apply/source-snapshots.js.test.cjs index b3271948..76b45964 100644 --- a/tap-snapshots/test/apply/source-snapshots.js.test.cjs +++ b/tap-snapshots/test/apply/source-snapshots.js.test.cjs @@ -889,17 +889,10 @@ jobs: run: | EXIT_CODE=0 - function each_release { - if npm view "$@" --loglevel=error > /dev/null; then - echo 0 - else - echo 1 - fi - } - for release in $(echo $RELEASES | jq -r '.[] | @base64'); do SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)" - STATUS=$(each_release "$SPEC") + npm view "$SPEC" --json + STATUS=$? if [[ "$STATUS" -eq 1 ]]; then EXIT_CODE=$STATUS echo "$SPEC ERROR" @@ -2526,17 +2519,10 @@ jobs: run: | EXIT_CODE=0 - function each_release { - if npm view "$@" --loglevel=error > /dev/null; then - echo 0 - else - echo 1 - fi - } - for release in $(echo $RELEASES | jq -r '.[] | @base64'); do SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)" - STATUS=$(each_release "$SPEC") + npm view "$SPEC" --json + STATUS=$? if [[ "$STATUS" -eq 1 ]]; then EXIT_CODE=$STATUS echo "$SPEC ERROR" @@ -4035,17 +4021,10 @@ jobs: run: | EXIT_CODE=0 - function each_release { - if npm view "$@" --loglevel=error > /dev/null; then - echo 0 - else - echo 1 - fi - } - for release in $(echo $RELEASES | jq -r '.[] | @base64'); do SPEC="$(echo "$release" | base64 --decode | jq -r .pkgName)@$(echo "$release" | base64 --decode | jq -r .version)" - STATUS=$(each_release "$SPEC") + npm view "$SPEC" --json + STATUS=$? if [[ "$STATUS" -eq 1 ]]; then EXIT_CODE=$STATUS echo "$SPEC ERROR"