@@ -122,20 +122,33 @@ jobs:
122122 package : ./packages/contentstack-auth/package.json
123123 tag : beta
124124
125+ - name : Read platform plugins version
126+ id : plugins-version
127+ if : >-
128+ ${{
129+ steps.dev-dependencies-installation.conclusion == 'success' ||
130+ steps.utilities-installation.conclusion == 'success' ||
131+ steps.command-installation.conclusion == 'success' ||
132+ steps.config-installation.conclusion == 'success' ||
133+ steps.auth-installation.conclusion == 'success'
134+ }}
135+ run : |
136+ VERSION=$(jq -r .version ./package.json)
137+ echo "version=$VERSION" >> "$GITHUB_OUTPUT"
138+
125139 - name : Create Platform Plugins Beta Release
126- # Adjust the ID below to match your actual publishing step ID for plugins
127- if : ${{ steps.publish-plugins.conclusion == 'success' }}
140+ if : ${{ steps.plugins-version.conclusion == 'success' }}
128141 id : create_release_plugins
129142 env :
130- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
131- # Extract version from the output of your plugin publish step
132- VERSION : ${{ steps.publish-plugins.outputs.version }}
143+ GITHUB_TOKEN : ${{ secrets.PKG_TOKEN }}
144+ VERSION : ${{ steps.plugins-version.outputs.version }}
133145 run : |
134- # Look for the last release specifically starting with 'plugins@v'
135- PREVIOUS_BETA=$(gh release list --limit 50 | grep 'platform-plugins@v' | grep 'beta' | head -1 | cut -f1)
136-
137- if [ -n "$PREVIOUS_BETA" ]; then
138- gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --notes-from-tag "$PREVIOUS_BETA" --prerelease
146+ TAG="platform-plugins@v${VERSION}"
147+ if gh release view "$TAG" &>/dev/null; then
148+ echo "Release $TAG already exists — skipping."
139149 else
140- gh release create "platform-plugins@v$VERSION" --title "Platform Plugins Beta $VERSION" --generate-notes --prerelease
150+ gh release create "$TAG" \
151+ --title "Platform Plugins Beta $VERSION" \
152+ --generate-notes \
153+ --prerelease
141154 fi
0 commit comments