Skip to content

Commit

Permalink
chore: support 'empty' release (#3709)
Browse files Browse the repository at this point in the history
This allows for the first phase of the release.yml, `release` to work
without any packages changes.
It skips git tag publishing but do the rest as usual.
  • Loading branch information
louis-bompart authored Mar 13, 2024
1 parent e15ad13 commit 3dd0967
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions utils/release/git-publish-all.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
import {createAppAuth} from '@octokit/auth-app';
import {spawnSync} from 'child_process';
import {randomUUID} from 'crypto';
import {readFileSync} from 'fs';
import {accessSync, constants, existsSync, readFileSync} from 'fs';
import {Octokit} from 'octokit';
import {dedent} from 'ts-dedent';
import {
Expand All @@ -40,9 +40,11 @@ process.chdir(process.env.INIT_CWD);
});

// Find all packages that have been released in this release.
const packagesReleased = readFileSync('.git-message', {
encoding: 'utf-8',
}).trim();
const packagesReleased = existsSync('.git-message')
? readFileSync('.git-message', {
encoding: 'utf-8',
}).trim()
: '';

// Compile git commit message
const commitMessage = dedent`
Expand Down

0 comments on commit 3dd0967

Please sign in to comment.