Skip to content

Commit

Permalink
Set version in package.json before publish
Browse files Browse the repository at this point in the history
  • Loading branch information
Sven65 committed Sep 9, 2024
1 parent e3676c6 commit 1934472
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ jobs:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get latest release version
id: get-version
run: |
Expand All @@ -39,6 +35,13 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Update version in package.json
run: |
# Read the latest release version from environment variable
LATEST_VERSION="${env.LATEST_RELEASE}"
# Update the "version" field in package.json using jq
jq --arg version "$LATEST_VERSION" '.version = $version' package.json > temp.json && mv temp.json package.json
- name: Setup node
uses: actions/setup-node@v3
with:
Expand Down

0 comments on commit 1934472

Please sign in to comment.