diff --git a/.github/workflows/build-push-release.yml b/.github/workflows/build-push-release.yml index cf85a49..b6663f2 100644 --- a/.github/workflows/build-push-release.yml +++ b/.github/workflows/build-push-release.yml @@ -82,16 +82,27 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This is needed for the gh cli - # Create a preview tag if on the main branch + # Create a preview tag if on the main branch and dist has changed - name: Create Preview Tag - if: github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' && steps.check_dist_changes.outputs.dist_changed == 'true' run: | git tag v${{ steps.gitversion.outputs.semVer }} git push origin v${{ steps.gitversion.outputs.semVer }} - # Create Release if on a release branch + # Create a draft release for the preview tag if on the main branch and dist has changed + - name: Create Draft Release + if: github.ref == 'refs/heads/main' && steps.check_dist_changes.outputs.dist_changed == 'true' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create v${{ steps.gitversion.outputs.semVer }} \ + --title "Preview Release ${{ steps.gitversion.outputs.semVer }}" \ + --notes "This is a preview release for version ${{ steps.gitversion.outputs.semVer }}." \ + --draft + + # Create Release if on a release branch and dist has changed - name: Create Release - if: startsWith(github.ref, 'refs/heads/releases/') + if: startsWith(github.ref, 'refs/heads/releases/') && steps.check_dist_changes.outputs.dist_changed == 'true' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/src/action.ts b/src/action.ts index 8c63078..07a2095 100644 --- a/src/action.ts +++ b/src/action.ts @@ -14,7 +14,7 @@ export async function run() { // Load the configuration const workspacePath = process.env.GITHUB_WORKSPACE || ''; const config = loadConfig(workspacePath); - console.log('Config loaded:', JSON.stringify(config, null, 2)); + console.log('Config loaded: ', JSON.stringify(config, null, 2)); core.debug(`Loaded config: ${JSON.stringify(config)}`); const time = (new Date()).toTimeString();