Skip to content

Commit

Permalink
Early exit when version already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
ajthinking committed Aug 1, 2023
1 parent 710f8d2 commit 7e13011
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/publish_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Check version
id: check
run: |
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
echo "::set-output name=version::$PACKAGE_VERSION"
RESPONSE=$(curl --silent --head --fail https://registry.npmjs.org/@data-story/core/$PACKAGE_VERSION)
if [ $? -eq 0 ]; then
echo "Version $PACKAGE_VERSION already exists. Exiting the action script."
exit 0
fi
- name: remove overlying workspace
run: rm ../../yarn.lock && rm ../../package.json

Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/publish_ui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ jobs:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'

- name: Check version
id: check
run: |
PACKAGE_VERSION=$(node -p -e "require('./package.json').version")
echo "::set-output name=version::$PACKAGE_VERSION"
RESPONSE=$(curl --silent --head --fail https://registry.npmjs.org/@data-story/ui/$PACKAGE_VERSION)
if [ $? -eq 0 ]; then
echo "Version $PACKAGE_VERSION already exists. Exiting the action script."
exit 0
fi
- name: remove overlying workspace
run: rm ../../yarn.lock && rm ../../package.json

Expand Down

0 comments on commit 7e13011

Please sign in to comment.