From 9abc0d65d1b1f9c9217eb55f7ac475e561e3c57d Mon Sep 17 00:00:00 2001
From: Sergii Stotskyi <sergiy.stotskiy@gmail.com>
Date: Sun, 16 Jun 2024 08:28:22 +0300
Subject: [PATCH] fix: removes redundant comment

---
 .github/workflows/release.yml       | 14 +++++++++-----
 packages/casl-mongoose/src/index.ts |  1 -
 packages/dx/bin/release-packages.sh |  2 +-
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index b48d57afd..52092420c 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -1,7 +1,7 @@
 name: Release packages
 on:
   pull_request:
-    types: [closed, labeled]
+    # types: [closed, labeled]
   # workflow_dispatch:
   #   inputs:
   #     packagePath:
@@ -46,8 +46,7 @@ jobs:
           GH_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
           NPM_TOKEN: ${{ secrets.RELEASE_NPM_TOKEN }}
           ACTIONS_STEP_DEBUG: ${{ secrets.ACTIONS_STEP_DEBUG }}
-          PREVIEW_BRANCH: ${{ github.event.pull_request.merged != true && github.head_ref }}
-          GITHUB_REF: ${{ github.head_ref }}
+          PREVIEW_RELEASE: ${{ github.event.pull_request.merged == true && 'no' || 'yes' }}
           # GITHUB_CONTEXT: ${{ toJson(github) }}
         run: |
           if [[ "${TRACE:-false}" == true || "${ACTIONS_STEP_DEBUG:-false}" == true ]]; then
@@ -56,14 +55,19 @@ jobs:
           unset GITHUB_ACTIONS
           . ./packages/dx/bin/release-packages.sh
 
+          preview_branch=""
+          if [ "$PREVIEW_RELEASE" = "yes" ]; then
+            preview_branch="${{ github.head_ref }}"
+          fi
+
           changed_paths="$(gh pr view --json files --jq '.files.[].path' "${{ github.event.pull_request.number }}" | cut -d / -f 1,2 | uniq)";
-          release_notes=$(release_packages "$changed_paths" "$PREVIEW_BRANCH")
+          release_notes=$(release_packages "$changed_paths" "$preview_branch")
           echo "$release_notes"
 
           if [ "${{github.event.pull_request.number}}" != "" ]; then
             released_packages=$(extract_package_versions "$changed_paths");
 
-            if [ "$PREVIEW_BRANCH" = "" ]; then
+            if [ "$preview_branch" = "" ]; then
               if [ "$released_packages" != "" ]; then
                 gh pr comment "${{ github.event.pull_request.number }}" --body "🚀 This PR changes was released in ${released_packages}"
               else
diff --git a/packages/casl-mongoose/src/index.ts b/packages/casl-mongoose/src/index.ts
index e870d523f..2b9aa296c 100644
--- a/packages/casl-mongoose/src/index.ts
+++ b/packages/casl-mongoose/src/index.ts
@@ -30,4 +30,3 @@ export { accessibleBy } from './accessibleBy';
 export type { AccessibleRecords } from './accessibleBy';
 
 export { accessibleFieldsBy } from './accessibleFieldsBy';
-// test changes
diff --git a/packages/dx/bin/release-packages.sh b/packages/dx/bin/release-packages.sh
index 38a136c3f..b7f978e98 100755
--- a/packages/dx/bin/release-packages.sh
+++ b/packages/dx/bin/release-packages.sh
@@ -36,7 +36,7 @@ ______HERE__;
     release_options="  --dry-run --no-ci --branches master,$preview_branch"
   fi
   echo "running: pnpm run -r $pnpm_options release $release_options" >> $GITHUB_STEP_SUMMARY
-  pnpm run -r $pnpm_options release $release_options
+  pnpm run -r $pnpm_options release --dry-run $release_options
 }
 
 extract_package_versions() {