Skip to content

Commit

Permalink
workflow: Correcting path to package.json
Browse files Browse the repository at this point in the history
Corrected the path to Cluster UI package.json, based on working
directory for the job. There was also an erroneous quote left in the npm
command that was removed.

Also, added a condition to the job to not run on forks of the
repository.

Epic CC-7999
see also CC-7959

Release note: None
  • Loading branch information
Nathan Stilwell committed Nov 15, 2022
1 parent 47c7b3a commit d80a32e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/cluster-ui-release-next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
publish_cluster_ui:
if: github.repository == 'cockroachdb/cockroach'
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
id: version-check
shell: bash
run: |
PACKAGE_VERSION=$(cat ./pkg/ui/workspaces/cluster-ui/package.json | jq -r ".version");
PACKAGE_VERSION=$(cat ./package.json | jq -r ".version");
VERSIONS=$(npm view @cockroachlabs/cluster-ui versions)
if [[ $VERSIONS == *"$PACKAGE_VERSION"* ]]; then
echo "published=yes" >> $GITHUB_OUTPUT
Expand All @@ -57,4 +58,4 @@ jobs:
- name: Publish prerelease version
if: steps.version-check.outputs.published == 'no'
run: npm publish --access public --tag next --dry-run"
run: npm publish --access public --tag next --dry-run
5 changes: 3 additions & 2 deletions .github/workflows/cluster-ui-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

jobs:
publish_cluster_ui:
if: github.repository == 'cockroachdb/cockroach'
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -39,7 +40,7 @@ jobs:
id: version-check
shell: bash
run: |
PACKAGE_VERSION=$(cat ./pkg/ui/workspaces/cluster-ui/package.json | jq -r ".version");
PACKAGE_VERSION=$(cat ./package.json | jq -r ".version");
VERSIONS=$(npm view @cockroachlabs/cluster-ui versions)
if [[ $VERSIONS == *"$PACKAGE_VERSION"* ]]; then
echo "published=yes" >> $GITHUB_OUTPUT
Expand All @@ -62,4 +63,4 @@ jobs:
- name: Publish patch version
if: steps.version-check.outputs.published == 'no'
run: npm publish --access public --tag ${{ steps.branch_name.outputs.branch }} --dry-run"
run: npm publish --access public --tag ${{ steps.branch_name.outputs.branch }} --dry-run

0 comments on commit d80a32e

Please sign in to comment.