From f782fbefd173f24c4fd45351077586aff8f8aa7a Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Tue, 26 Sep 2023 08:20:58 +0000 Subject: [PATCH 1/4] fix: upgrade @braintree/sanitize-url from 6.0.3 to 6.0.4 Snyk has created this PR to upgrade @braintree/sanitize-url from 6.0.3 to 6.0.4. See this package in npm: https://www.npmjs.com/package/@braintree/sanitize-url See this project in Snyk: https://app.snyk.io/org/contentstack-cli/project/891ca47c-40f9-48a7-8e73-9ead911aadf5?utm_source=github&utm_medium=referral&page=upgrade-pr --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index d4b28e3..a4ab437 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@contentstack/datasync-manager", - "version": "2.0.3", + "version": "2.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@contentstack/datasync-manager", - "version": "2.0.3", + "version": "2.0.4", "license": "MIT", "dependencies": { - "@braintree/sanitize-url": "^6.0.3", + "@braintree/sanitize-url": "^6.0.4", "debug": "^4.3.4", "dns-socket": "^4.2.2", "lodash": "^4.17.21", @@ -1939,9 +1939,9 @@ "dev": true }, "node_modules/@braintree/sanitize-url": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.3.tgz", - "integrity": "sha512-g2hMyGSFYOvt0eeY2c2wrG1B6dVWF1be4vGxG9mI1BEHJuQm4Hie2HrooxYHBDRDi8hANIzQ8cuvBgxSVlQOTQ==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.4.tgz", + "integrity": "sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==" }, "node_modules/@colors/colors": { "version": "1.5.0", @@ -14631,9 +14631,9 @@ "dev": true }, "@braintree/sanitize-url": { - "version": "6.0.3", - "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.3.tgz", - "integrity": "sha512-g2hMyGSFYOvt0eeY2c2wrG1B6dVWF1be4vGxG9mI1BEHJuQm4Hie2HrooxYHBDRDi8hANIzQ8cuvBgxSVlQOTQ==" + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/@braintree/sanitize-url/-/sanitize-url-6.0.4.tgz", + "integrity": "sha512-s3jaWicZd0pkP0jf5ysyHUI/RE7MHos6qlToFcGWXVp+ykHOy77OUMrfbgJ9it2C5bow7OIQwYYaHjk9XlBQ2A==" }, "@colors/colors": { "version": "1.5.0", diff --git a/package.json b/package.json index b6072eb..7e11c89 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "The primary module of Contentstack DataSync. Syncs Contentstack data with your server using Contentstack Sync API", "main": "dist/index.js", "dependencies": { - "@braintree/sanitize-url": "^6.0.3", + "@braintree/sanitize-url": "^6.0.4", "debug": "^4.3.4", "dns-socket": "^4.2.2", "lodash": "^4.17.21", From 25b3a8267b1dd629bd3179c86807b27481cddedc Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 3 Oct 2023 16:39:57 +0530 Subject: [PATCH 2/4] modified the release workflow so as to not to release the same version, added auto generate notes and creating tags --- .github/workflows/release.yml | 52 ++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 00def29..57bfaf1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release datasync manager on: push: - branches: [master] + branches: [main] jobs: build: runs-on: ubuntu-latest @@ -10,11 +10,61 @@ jobs: - uses: actions/setup-node@v3.7.0 with: node-version: "18.x" +# The below action will see the existing tags and will bump the current ones and this is only used to check whether the given tag already exists or not +# We will be using the previous tag to compare with the current tag in the package.json +# If both match then no new release would be triggered +# Else New release will be created + - name: Bump version and push tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + default_bump: false +# Getting the version info from package.json + - name: get-npm-version + id: package-version + uses: martinbeentjes/npm-get-version-action@v1.3.1 +# Here we are checking whether this is the first release or not and then checking if it is release or not + - name: check-first-release + env: + First_Release: ${{steps.tag_version.outputs.previous_tag=='v0.0.0'}} + run: | + if ${First_Release} == true; then + echo "fr=true" >> $GITHUB_ENV + echo "flag set to true" + else + echo "fr=false" >> $GITHUB_ENV + echo "flag set to false" + fi + - name: check-release-version + if: ${{env.fr=='false'}} + env: + old_version: ${{steps.tag_version.outputs.previous_tag}} + new_version: v${{steps.package-version.outputs.current-version}} + run: | + echo ${old_version} + echo ${new_version} + echo ${{env.old_version==env.new_version}} + if ${{env.old_version!=env.new_version}}; then + echo "fr=true" >> $GITHUB_ENV + echo "flag set to true" + else + echo "fr=false" >> $GITHUB_ENV + echo "flag set to false" + fi - name: Installing dependencies run: npm install - name: Build run: npm run build-ts - name: Publishing datasync manager + id: publish-core uses: JS-DevTools/npm-publish@v2.2.0 + if: ${{env.fr=='true'}} with: token: ${{ secrets.NPM_TOKEN }} + - name: Create Release + id: create_release + if: ${{env.fr=='true'}} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release create v${{ steps.publish-core.outputs.version }} --title "Release ${{ steps.publish-core.outputs.version }}" --generate-notes \ No newline at end of file From 3c604216c3a95243967b1cd681436f51000194a6 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Tue, 3 Oct 2023 16:41:36 +0530 Subject: [PATCH 3/4] npm audit fix and changed branch to master from main --- .github/workflows/release.yml | 2 +- package-lock.json | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 57bfaf1..9f10b07 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,7 +1,7 @@ name: Release datasync manager on: push: - branches: [main] + branches: [master] jobs: build: runs-on: ubuntu-latest diff --git a/package-lock.json b/package-lock.json index d4b28e3..55ddff1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/datasync-manager", - "version": "2.0.3", + "version": "2.0.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@contentstack/datasync-manager", - "version": "2.0.3", + "version": "2.0.4", "license": "MIT", "dependencies": { "@braintree/sanitize-url": "^6.0.3", @@ -5110,9 +5110,9 @@ } }, "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true, "engines": { "node": "*" @@ -17014,9 +17014,9 @@ "dev": true }, "get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha512-Hm0ixYtaSZ/V7C8FJrtZIuBBI+iSgL+1Aq82zSu8VQNB4S3Gk8e7Qs3VwBDJAhmRZcFqkl3tQu36g/Foh5I5ig==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", "dev": true }, "get-intrinsic": { From 18be59d555e94857fac64b162e33c5fc48564b38 Mon Sep 17 00:00:00 2001 From: raj pandey Date: Wed, 4 Oct 2023 12:20:11 +0530 Subject: [PATCH 4/4] version bump --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 55ddff1..aef1789 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@contentstack/datasync-manager", - "version": "2.0.4", + "version": "2.0.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@contentstack/datasync-manager", - "version": "2.0.4", + "version": "2.0.5", "license": "MIT", "dependencies": { "@braintree/sanitize-url": "^6.0.3", diff --git a/package.json b/package.json index b6072eb..0b6b2d1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@contentstack/datasync-manager", "author": "Contentstack LLC ", - "version": "2.0.4", + "version": "2.0.5", "description": "The primary module of Contentstack DataSync. Syncs Contentstack data with your server using Contentstack Sync API", "main": "dist/index.js", "dependencies": {