Skip to content

Commit de18fea

Browse files
committed
wip(node-version): passed the version from the release lifter to the release scaffolder
1 parent c454a35 commit de18fea

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/semantic-release/ci-providers/github-workflows/release-workflow-for-alpha/lifter-test.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import lift from './lifter';
1212
suite('release workflow lifter', () => {
1313
let sandbox;
1414
const projectRoot = any.string();
15+
const nodeVersion = any.string();
1516
const workflowsDirectory = `${projectRoot}/.github/workflows`;
1617
const pathToReleaseWorkflowFile = `${workflowsDirectory}/release.yml`;
1718
const existingWorkflowContents = any.string();
@@ -30,19 +31,19 @@ suite('release workflow lifter', () => {
3031
test('that the scaffolder is called when a release workflow does not exist', async () => {
3132
core.fileExists.resolves(false);
3233

33-
await lift({projectRoot});
34+
await lift({projectRoot, nodeVersion});
3435

35-
assert.calledWith(scaffolder.default, {projectRoot});
36+
assert.calledWith(scaffolder.default, {projectRoot, nodeVersion});
3637
});
3738

3839
test('that the scaffolder is re-run when the release workflow is dispatchable', async () => {
3940
core.fileExists.withArgs(pathToReleaseWorkflowFile).resolves(true);
4041
fs.readFile.withArgs(pathToReleaseWorkflowFile, 'utf-8').resolves(existingWorkflowContents);
4142
jsYaml.load.withArgs(existingWorkflowContents).returns({on: {workflow_dispatch: {}}});
4243

43-
await lift({projectRoot});
44+
await lift({projectRoot, nodeVersion});
4445

45-
assert.calledWith(scaffolder.default, {projectRoot});
46+
assert.calledWith(scaffolder.default, {projectRoot, nodeVersion});
4647
});
4748

4849
test('that the scaffolder is not called when a modern release workflow already exists', async () => {

src/semantic-release/ci-providers/github-workflows/release-workflow-for-alpha/lifter.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ async function releaseWorkflowShouldBeScaffolded(pathToReleaseWorkflowFile) {
99
|| load(await fs.readFile(pathToReleaseWorkflowFile, 'utf-8')).on.workflow_dispatch;
1010
}
1111

12-
export default async function ({projectRoot}) {
12+
export default async function ({projectRoot, nodeVersion}) {
1313
const workflowsDirectory = `${projectRoot}/.github/workflows`;
1414
const pathToReleaseWorkflowFile = `${workflowsDirectory}/release.yml`;
1515

1616
if (await releaseWorkflowShouldBeScaffolded(pathToReleaseWorkflowFile)) {
17-
return scaffolder({projectRoot});
17+
return scaffolder({projectRoot, nodeVersion});
1818
}
1919

2020
return undefined;

0 commit comments

Comments
 (0)