Skip to content

Commit a32f670

Browse files
committed
Pipeline updated
1 parent a257023 commit a32f670

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.github/workflows/publish.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
node-version: '18'
2222
registry-url: 'https://registry.npmjs.org'
2323

24+
- name: Log github.ref
25+
run: |
26+
echo "github.ref: ${{ github.ref }}"
27+
2428
- name: Get tag info
2529
id: tag
2630
run: |
@@ -34,6 +38,7 @@ jobs:
3438
id: version
3539
run: |
3640
echo "Determining branch and version..."
41+
echo "github.ref: ${{ github.ref }}"
3742
if [[ "${{ github.ref }}" == "refs/heads/develop" ]]; then
3843
echo "Tag was created from the develop branch."
3944
TIMESTAMP=$(date -u +"%Y%m%d%H%M%S")
@@ -51,7 +56,17 @@ jobs:
5156
echo "CHANNEL=latest" >> $GITHUB_ENV
5257
fi
5358
54-
- name: Update package.json version
59+
- name: Check current version in package.json
60+
id: current-version
61+
run: |
62+
echo "Checking current version in package.json..."
63+
CURRENT_VERSION=$(node -p "require('./package.json').version")
64+
echo "CURRENT_VERSION=$CURRENT_VERSION"
65+
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_ENV
66+
echo "CURRENT_VERSION=$CURRENT_VERSION" >> $GITHUB_OUTPUT
67+
68+
- name: Update package.json version if necessary
69+
if: env.CURRENT_VERSION != env.VERSION
5570
run: |
5671
echo "Updating package.json version to ${{ env.VERSION }}..."
5772
npm version ${{ env.VERSION }} --no-git-tag-version
@@ -79,7 +94,7 @@ jobs:
7994
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
8095

8196
- name: Commit and push changes to develop
82-
if: github.ref == 'refs/heads/develop'
97+
if: github.ref == 'refs/heads/develop' && env.CURRENT_VERSION != env.VERSION
8398
run: |
8499
echo "Preparing to commit and push changes to develop..."
85100
git config --global user.name "GitHub Actions"

0 commit comments

Comments
 (0)