mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2026-11-29 11:34:36 +01:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
592200bd4b | ||
|
|
12f4debbf6 | ||
|
|
ae80d4ecaa | ||
|
|
d00c6817f1 |
No files matched your search
@@ -20,7 +20,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||||
tofu-versions: [1.6.0-alpha1, latest]
|
tofu-versions: [1.6.0, latest]
|
||||||
tofu-wrapper: [true, false]
|
tofu-wrapper: [true, false]
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
|||||||
Vendored
+14
-15
@@ -10,16 +10,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class Build {
|
class Build {
|
||||||
constructor (name, url) {
|
constructor (version, name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.url = url;
|
this.url = 'https://github.com/opentofu/opentofu/releases/download/v' + version + '/' + name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Release {
|
class Release {
|
||||||
constructor (releaseMeta) {
|
constructor (releaseMeta) {
|
||||||
this.version = releaseMeta.tag_name.replace('v', '');
|
this.version = releaseMeta.id.replace('v', '');
|
||||||
this.builds = releaseMeta.assets.map(asset => new Build(asset.name, asset.browser_download_url));
|
this.builds = releaseMeta.files.map(asset => new Build(this.version, asset));
|
||||||
}
|
}
|
||||||
|
|
||||||
getBuild (platform, arch) {
|
getBuild (platform, arch) {
|
||||||
@@ -34,17 +34,12 @@ class Release {
|
|||||||
* @return {Array<Release>} Releases.
|
* @return {Array<Release>} Releases.
|
||||||
*/
|
*/
|
||||||
async function fetchReleases (githubToken) {
|
async function fetchReleases (githubToken) {
|
||||||
const url = 'https://api.github.com/repos/opentofu/opentofu/releases';
|
const url = 'https://get.opentofu.org/tofu/api.json';
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: 'application/vnd.github+json',
|
Accept: 'application/json'
|
||||||
'X-GitHub-Api-Version': '2022-11-28'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (githubToken) {
|
|
||||||
headers.Authorization = `Bearer ${githubToken}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const resp = await fetch(url, {
|
const resp = await fetch(url, {
|
||||||
headers
|
headers
|
||||||
});
|
});
|
||||||
@@ -54,14 +49,18 @@ async function fetchReleases (githubToken) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const releasesMeta = await resp.json();
|
const releasesMeta = await resp.json();
|
||||||
|
/**
|
||||||
|
* @type {Array}
|
||||||
|
*/
|
||||||
|
const versions = releasesMeta.versions;
|
||||||
|
|
||||||
return releasesMeta.map(releaseMeta => new Release(releaseMeta));
|
return versions.map(releaseMeta => new Release(releaseMeta));
|
||||||
}
|
}
|
||||||
|
|
||||||
const semver = __nccwpck_require__(1383);
|
const semver = __nccwpck_require__(1383);
|
||||||
|
|
||||||
async function findLatestVersion (versions) {
|
async function findLatestVersion (versions) {
|
||||||
return versions.sort((a, b) => semver.rcompare(a, b))[0];
|
return versions.filter((v) => semver.prerelease(v) === null).sort((a, b) => semver.rcompare(a, b))[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findLatestVersionInRange (versions, range) {
|
async function findLatestVersionInRange (versions, range) {
|
||||||
@@ -168,7 +167,7 @@ async function downloadAndExtractCLI (url) {
|
|||||||
if (os.platform().startsWith('win')) {
|
if (os.platform().startsWith('win')) {
|
||||||
core.debug(`OpenTofu CLI Download Path is ${pathToCLIZip}`);
|
core.debug(`OpenTofu CLI Download Path is ${pathToCLIZip}`);
|
||||||
const fixedPathToCLIZip = `${pathToCLIZip}.zip`;
|
const fixedPathToCLIZip = `${pathToCLIZip}.zip`;
|
||||||
io.mv(pathToCLIZip, fixedPathToCLIZip);
|
await io.mv(pathToCLIZip, fixedPathToCLIZip);
|
||||||
core.debug(`Moved download to ${fixedPathToCLIZip}`);
|
core.debug(`Moved download to ${fixedPathToCLIZip}`);
|
||||||
pathToCLI = await tc.extractZip(fixedPathToCLIZip);
|
pathToCLI = await tc.extractZip(fixedPathToCLIZip);
|
||||||
} else {
|
} else {
|
||||||
@@ -225,7 +224,7 @@ async function addCredentials (credentialsHostname, credentialsToken, osPlat) {
|
|||||||
credentials "${credentialsHostname}" {
|
credentials "${credentialsHostname}" {
|
||||||
token = "${credentialsToken}"
|
token = "${credentialsToken}"
|
||||||
}`.trim();
|
}`.trim();
|
||||||
// eslint-enable
|
// eslint-enable
|
||||||
|
|
||||||
// default to OS-specific path
|
// default to OS-specific path
|
||||||
let credsFile = osPlat === 'win32'
|
let credsFile = osPlat === 'win32'
|
||||||
|
|||||||
Vendored
+6
-5
@@ -4210,13 +4210,14 @@ async function checkTofu () {
|
|||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
const options = {
|
const options = {
|
||||||
listeners,
|
listeners,
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true,
|
||||||
|
silent: true // don't print "[command...]" into stdout: https://github.com/actions/toolkit/issues/649
|
||||||
};
|
};
|
||||||
const exitCode = await exec(pathToCLI, args, options);
|
const exitCode = await exec(pathToCLI, args, options);
|
||||||
core.debug(`OpenTofu exited with code ${exitCode}.`);
|
|
||||||
core.debug(`stdout: ${stdout.contents}`);
|
// Pass-through stdout/err as `exec` won't due to `silent: true` option
|
||||||
core.debug(`stderr: ${stderr.contents}`);
|
process.stdout.write(stdout.contents);
|
||||||
core.debug(`exitcode: ${exitCode}`);
|
process.stderr.write(stderr.contents);
|
||||||
|
|
||||||
// Set outputs, result, exitcode, and stderr
|
// Set outputs, result, exitcode, and stderr
|
||||||
core.setOutput('stdout', stdout.contents);
|
core.setOutput('stdout', stdout.contents);
|
||||||
|
|||||||
+12
-13
@@ -4,16 +4,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class Build {
|
class Build {
|
||||||
constructor (name, url) {
|
constructor (version, name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
this.url = url;
|
this.url = 'https://github.com/opentofu/opentofu/releases/download/v' + version + '/' + name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Release {
|
class Release {
|
||||||
constructor (releaseMeta) {
|
constructor (releaseMeta) {
|
||||||
this.version = releaseMeta.tag_name.replace('v', '');
|
this.version = releaseMeta.id.replace('v', '');
|
||||||
this.builds = releaseMeta.assets.map(asset => new Build(asset.name, asset.browser_download_url));
|
this.builds = releaseMeta.files.map(asset => new Build(this.version, asset));
|
||||||
}
|
}
|
||||||
|
|
||||||
getBuild (platform, arch) {
|
getBuild (platform, arch) {
|
||||||
@@ -28,17 +28,12 @@ class Release {
|
|||||||
* @return {Array<Release>} Releases.
|
* @return {Array<Release>} Releases.
|
||||||
*/
|
*/
|
||||||
async function fetchReleases (githubToken) {
|
async function fetchReleases (githubToken) {
|
||||||
const url = 'https://api.github.com/repos/opentofu/opentofu/releases';
|
const url = 'https://get.opentofu.org/tofu/api.json';
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: 'application/vnd.github+json',
|
Accept: 'application/json'
|
||||||
'X-GitHub-Api-Version': '2022-11-28'
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (githubToken) {
|
|
||||||
headers.Authorization = `Bearer ${githubToken}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
const resp = await fetch(url, {
|
const resp = await fetch(url, {
|
||||||
headers
|
headers
|
||||||
});
|
});
|
||||||
@@ -48,14 +43,18 @@ async function fetchReleases (githubToken) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const releasesMeta = await resp.json();
|
const releasesMeta = await resp.json();
|
||||||
|
/**
|
||||||
|
* @type {Array}
|
||||||
|
*/
|
||||||
|
const versions = releasesMeta.versions;
|
||||||
|
|
||||||
return releasesMeta.map(releaseMeta => new Release(releaseMeta));
|
return versions.map(releaseMeta => new Release(releaseMeta));
|
||||||
}
|
}
|
||||||
|
|
||||||
const semver = require('semver');
|
const semver = require('semver');
|
||||||
|
|
||||||
async function findLatestVersion (versions) {
|
async function findLatestVersion (versions) {
|
||||||
return versions.sort((a, b) => semver.rcompare(a, b))[0];
|
return versions.filter((v) => semver.prerelease(v) === null).sort((a, b) => semver.rcompare(a, b))[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
async function findLatestVersionInRange (versions, range) {
|
async function findLatestVersionInRange (versions, range) {
|
||||||
|
|||||||
+2
-2
@@ -48,7 +48,7 @@ async function downloadAndExtractCLI (url) {
|
|||||||
if (os.platform().startsWith('win')) {
|
if (os.platform().startsWith('win')) {
|
||||||
core.debug(`OpenTofu CLI Download Path is ${pathToCLIZip}`);
|
core.debug(`OpenTofu CLI Download Path is ${pathToCLIZip}`);
|
||||||
const fixedPathToCLIZip = `${pathToCLIZip}.zip`;
|
const fixedPathToCLIZip = `${pathToCLIZip}.zip`;
|
||||||
io.mv(pathToCLIZip, fixedPathToCLIZip);
|
await io.mv(pathToCLIZip, fixedPathToCLIZip);
|
||||||
core.debug(`Moved download to ${fixedPathToCLIZip}`);
|
core.debug(`Moved download to ${fixedPathToCLIZip}`);
|
||||||
pathToCLI = await tc.extractZip(fixedPathToCLIZip);
|
pathToCLI = await tc.extractZip(fixedPathToCLIZip);
|
||||||
} else {
|
} else {
|
||||||
@@ -105,7 +105,7 @@ async function addCredentials (credentialsHostname, credentialsToken, osPlat) {
|
|||||||
credentials "${credentialsHostname}" {
|
credentials "${credentialsHostname}" {
|
||||||
token = "${credentialsToken}"
|
token = "${credentialsToken}"
|
||||||
}`.trim();
|
}`.trim();
|
||||||
// eslint-enable
|
// eslint-enable
|
||||||
|
|
||||||
// default to OS-specific path
|
// default to OS-specific path
|
||||||
let credsFile = osPlat === 'win32'
|
let credsFile = osPlat === 'win32'
|
||||||
|
|||||||
+139
-183
@@ -3,184 +3,133 @@ const pkg = require('../releases');
|
|||||||
describe('getRelease', () => {
|
describe('getRelease', () => {
|
||||||
function mockFetchReleases () {
|
function mockFetchReleases () {
|
||||||
const mockReleasesMeta = [{
|
const mockReleasesMeta = [{
|
||||||
tag_name: 'v1.6.0-alpha2',
|
id: 'v1.7.0-alpha2',
|
||||||
assets: [{
|
files: [
|
||||||
name: 'tofu_1.6.0-alpha2_386.apk',
|
'tofu_1.7.0-alpha2_386.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_386.apk'
|
'tofu_1.7.0-alpha2_386.deb',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_386.rpm',
|
||||||
name: 'tofu_1.6.0-alpha2_386.deb',
|
'tofu_1.7.0-alpha2_amd64.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_386.deb'
|
'tofu_1.7.0-alpha2_amd64.deb',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_amd64.rpm',
|
||||||
name: 'tofu_1.6.0-alpha2_386.rpm',
|
'tofu_1.7.0-alpha2_arm.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_386.rpm'
|
'tofu_1.7.0-alpha2_arm.deb',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_arm.rpm',
|
||||||
name: 'tofu_1.6.0-alpha2_amd64.apk',
|
'tofu_1.7.0-alpha2_arm64.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_amd64.apk'
|
'tofu_1.7.0-alpha2_arm64.deb',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_arm64.rpm',
|
||||||
name: 'tofu_1.6.0-alpha2_amd64.deb',
|
'tofu_1.7.0-alpha2_darwin_arm64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_amd64.deb'
|
'tofu_1.7.0-alpha2_freebsd_386.zip',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_freebsd_amd64.zip',
|
||||||
name: 'tofu_1.6.0-alpha2_amd64.rpm',
|
'tofu_1.7.0-alpha2_freebsd_arm.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_amd64.rpm'
|
'tofu_1.7.0-alpha2_linux_386.zip',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_linux_amd64.zip',
|
||||||
name: 'tofu_1.6.0-alpha2_arm.apk',
|
'tofu_1.7.0-alpha2_linux_arm.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_arm.apk'
|
'tofu_1.7.0-alpha2_linux_arm64.zip',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_openbsd_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha2_arm.deb',
|
'tofu_1.7.0-alpha2_openbsd_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_arm.deb'
|
'tofu_1.7.0-alpha2_SHA256SUMS',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_SHA256SUMS.pem',
|
||||||
name: 'tofu_1.6.0-alpha2_arm.rpm',
|
'tofu_1.7.0-alpha2_SHA256SUMS.sig',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_arm.rpm'
|
'tofu_1.7.0-alpha2_solaris_amd64.zip',
|
||||||
}, {
|
'tofu_1.7.0-alpha2_windows_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha2_arm64.apk',
|
'tofu_1.7.0-alpha2_windows_amd64.zip'
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_arm64.apk'
|
]
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_arm64.deb',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_arm64.deb'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_arm64.rpm',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_arm64.rpm'
|
|
||||||
}, {
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_darwin_amd64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_darwin_arm64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_darwin_arm64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_freebsd_386.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_freebsd_386.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_freebsd_amd64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_freebsd_amd64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_freebsd_arm.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_freebsd_arm.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_linux_386.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_linux_386.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_linux_amd64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_linux_amd64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_linux_arm.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_linux_arm.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_linux_arm64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_linux_arm64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_openbsd_386.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_openbsd_386.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_openbsd_amd64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_openbsd_amd64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_SHA256SUMS',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_SHA256SUMS'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_SHA256SUMS.pem',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_SHA256SUMS.pem'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_SHA256SUMS.sig',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_SHA256SUMS.sig'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_solaris_amd64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_solaris_amd64.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_windows_386.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_windows_386.zip'
|
|
||||||
}, {
|
|
||||||
name: 'tofu_1.6.0-alpha2_windows_amd64.zip',
|
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha2/tofu_1.6.0-alpha2_windows_amd64.zip'
|
|
||||||
}]
|
|
||||||
}, {
|
}, {
|
||||||
tag_name: 'v1.6.0-alpha1',
|
id: 'v1.6.0',
|
||||||
assets: [{
|
files: [
|
||||||
name: 'tofu_1.6.0-alpha1_386.apk',
|
'tofu_1.6.0_386.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_386.apk'
|
'tofu_1.6.0_386.deb',
|
||||||
}, {
|
'tofu_1.6.0_386.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_386.deb',
|
'tofu_1.6.0_amd64.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_386.deb'
|
'tofu_1.6.0_amd64.deb',
|
||||||
}, {
|
'tofu_1.6.0_amd64.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_386.rpm',
|
'tofu_1.6.0_arm.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_386.rpm'
|
'tofu_1.6.0_arm.deb',
|
||||||
}, {
|
'tofu_1.6.0_arm.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_amd64.apk',
|
'tofu_1.6.0_arm64.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_amd64.apk'
|
'tofu_1.6.0_arm64.deb',
|
||||||
}, {
|
'tofu_1.6.0_arm64.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_amd64.deb',
|
'tofu_1.6.0_darwin_arm64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_amd64.deb'
|
'tofu_1.6.0_freebsd_386.zip',
|
||||||
}, {
|
'tofu_1.6.0_freebsd_amd64.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_amd64.rpm',
|
'tofu_1.6.0_freebsd_arm.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_amd64.rpm'
|
'tofu_1.6.0_linux_386.zip',
|
||||||
}, {
|
'tofu_1.6.0_linux_amd64.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_arm.apk',
|
'tofu_1.6.0_linux_arm.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_arm.apk'
|
'tofu_1.6.0_linux_arm64.zip',
|
||||||
}, {
|
'tofu_1.6.0_openbsd_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_arm.deb',
|
'tofu_1.6.0_openbsd_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_arm.deb'
|
'tofu_1.6.0_SHA256SUMS',
|
||||||
}, {
|
'tofu_1.6.0_SHA256SUMS.pem',
|
||||||
name: 'tofu_1.6.0-alpha1_arm.rpm',
|
'tofu_1.6.0_SHA256SUMS.sig',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_arm.rpm'
|
'tofu_1.6.0_solaris_amd64.zip',
|
||||||
}, {
|
'tofu_1.6.0_windows_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_arm64.apk',
|
'tofu_1.6.0_windows_amd64.zip']
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_arm64.apk'
|
}, {
|
||||||
}, {
|
id: 'v1.6.0-alpha2',
|
||||||
name: 'tofu_1.6.0-alpha1_arm64.deb',
|
files: [
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_arm64.deb'
|
'tofu_1.6.0-alpha2_386.apk',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_386.deb',
|
||||||
name: 'tofu_1.6.0-alpha1_arm64.rpm',
|
'tofu_1.6.0-alpha2_386.rpm',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_arm64.rpm'
|
'tofu_1.6.0-alpha2_amd64.apk',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_amd64.deb',
|
||||||
name: 'tofu_1.6.0-alpha1_darwin_amd64.zip',
|
'tofu_1.6.0-alpha2_amd64.rpm',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_darwin_amd64.zip'
|
'tofu_1.6.0-alpha2_arm.apk',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_arm.deb',
|
||||||
name: 'tofu_1.6.0-alpha1_darwin_arm64.zip',
|
'tofu_1.6.0-alpha2_arm.rpm',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_darwin_arm64.zip'
|
'tofu_1.6.0-alpha2_arm64.apk',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_arm64.deb',
|
||||||
name: 'tofu_1.6.0-alpha1_freebsd_386.zip',
|
'tofu_1.6.0-alpha2_arm64.rpm',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_freebsd_386.zip'
|
'tofu_1.6.0-alpha2_darwin_arm64.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_freebsd_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_freebsd_amd64.zip',
|
'tofu_1.6.0-alpha2_freebsd_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_freebsd_amd64.zip'
|
'tofu_1.6.0-alpha2_freebsd_arm.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_linux_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_freebsd_arm.zip',
|
'tofu_1.6.0-alpha2_linux_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_freebsd_arm.zip'
|
'tofu_1.6.0-alpha2_linux_arm.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_linux_arm64.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_linux_386.zip',
|
'tofu_1.6.0-alpha2_openbsd_386.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_linux_386.zip'
|
'tofu_1.6.0-alpha2_openbsd_amd64.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_SHA256SUMS',
|
||||||
name: 'tofu_1.6.0-alpha1_linux_amd64.zip',
|
'tofu_1.6.0-alpha2_SHA256SUMS.pem',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_linux_amd64.zip'
|
'tofu_1.6.0-alpha2_SHA256SUMS.sig',
|
||||||
}, {
|
'tofu_1.6.0-alpha2_solaris_amd64.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_linux_arm.zip',
|
'tofu_1.6.0-alpha2_windows_386.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_linux_arm.zip'
|
'tofu_1.6.0-alpha2_windows_amd64.zip'
|
||||||
}, {
|
]
|
||||||
name: 'tofu_1.6.0-alpha1_linux_arm64.zip',
|
}, {
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_linux_arm64.zip'
|
id: 'v1.6.0-alpha1',
|
||||||
}, {
|
files: [
|
||||||
name: 'tofu_1.6.0-alpha1_openbsd_386.zip',
|
'tofu_1.6.0-alpha1_386.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_openbsd_386.zip'
|
'tofu_1.6.0-alpha1_386.deb',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_386.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_openbsd_amd64.zip',
|
'tofu_1.6.0-alpha1_amd64.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_openbsd_amd64.zip'
|
'tofu_1.6.0-alpha1_amd64.deb',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_amd64.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_SHA256SUMS',
|
'tofu_1.6.0-alpha1_arm.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_SHA256SUMS'
|
'tofu_1.6.0-alpha1_arm.deb',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_arm.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_SHA256SUMS.pem',
|
'tofu_1.6.0-alpha1_arm64.apk',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_SHA256SUMS.pem'
|
'tofu_1.6.0-alpha1_arm64.deb',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_arm64.rpm',
|
||||||
name: 'tofu_1.6.0-alpha1_SHA256SUMS.sig',
|
'tofu_1.6.0-alpha1_darwin_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_SHA256SUMS.sig'
|
'tofu_1.6.0-alpha1_darwin_arm64.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_freebsd_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_solaris_amd64.zip',
|
'tofu_1.6.0-alpha1_freebsd_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_solaris_amd64.zip'
|
'tofu_1.6.0-alpha1_freebsd_arm.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_linux_386.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_windows_386.zip',
|
'tofu_1.6.0-alpha1_linux_amd64.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_windows_386.zip'
|
'tofu_1.6.0-alpha1_linux_arm.zip',
|
||||||
}, {
|
'tofu_1.6.0-alpha1_linux_arm64.zip',
|
||||||
name: 'tofu_1.6.0-alpha1_windows_amd64.zip',
|
'tofu_1.6.0-alpha1_openbsd_386.zip',
|
||||||
browser_download_url: 'https://github.com/opentofu/opentofu/releases/download/v1.6.0-alpha1/tofu_1.6.0-alpha1_windows_amd64.zip'
|
'tofu_1.6.0-alpha1_openbsd_amd64.zip',
|
||||||
}]
|
'tofu_1.6.0-alpha1_SHA256SUMS',
|
||||||
|
'tofu_1.6.0-alpha1_SHA256SUMS.pem',
|
||||||
|
'tofu_1.6.0-alpha1_SHA256SUMS.sig',
|
||||||
|
'tofu_1.6.0-alpha1_solaris_amd64.zip',
|
||||||
|
'tofu_1.6.0-alpha1_windows_386.zip',
|
||||||
|
'tofu_1.6.0-alpha1_windows_amd64.zip'
|
||||||
|
]
|
||||||
}];
|
}];
|
||||||
|
|
||||||
return mockReleasesMeta.map(el => new pkg.Release(el));
|
return mockReleasesMeta.map(el => new pkg.Release(el));
|
||||||
@@ -188,12 +137,15 @@ describe('getRelease', () => {
|
|||||||
|
|
||||||
it.each(
|
it.each(
|
||||||
[
|
[
|
||||||
['latest', '1.6.0-alpha2'],
|
['latest', '1.6.0'],
|
||||||
['<1.6.0-beta', '1.6.0-alpha2'],
|
['<1.6.0-beta', '1.6.0-alpha2'],
|
||||||
['>1.6.0-alpha1', '1.6.0-alpha2'],
|
['>1.6.0-alpha1', '1.6.0'],
|
||||||
['>1.6.0-alpha1 <1.6.0', '1.6.0-alpha2'],
|
['>1.6.0-alpha1 <1.6.0', '1.6.0-alpha2'],
|
||||||
['~1.6.0-alpha', '1.6.0-alpha2'],
|
['~1.6.0-alpha', '1.6.0'],
|
||||||
['<=1.6.0-alpha1', '1.6.0-alpha1']
|
['<=1.6.0-alpha1', '1.6.0-alpha1'],
|
||||||
|
['>1.5.0', '1.6.0'],
|
||||||
|
['>1.5.0', '1.6.0'],
|
||||||
|
['>1.7.0-alpha', '1.7.0-alpha2']
|
||||||
]
|
]
|
||||||
)('happy path: getRelease(\'%s\') -> \'%s\'', async (input, wantVersion) => {
|
)('happy path: getRelease(\'%s\') -> \'%s\'', async (input, wantVersion) => {
|
||||||
const want = mockFetchReleases().find(el => el.version === wantVersion);
|
const want = mockFetchReleases().find(el => el.version === wantVersion);
|
||||||
@@ -205,8 +157,12 @@ describe('getRelease', () => {
|
|||||||
[
|
[
|
||||||
['foo', 'Input version cannot be used, see semver: https://semver.org/spec/v2.0.0.html', mockFetchReleases],
|
['foo', 'Input version cannot be used, see semver: https://semver.org/spec/v2.0.0.html', mockFetchReleases],
|
||||||
['2.0', 'No matching version found', mockFetchReleases],
|
['2.0', 'No matching version found', mockFetchReleases],
|
||||||
['latest', 'No tofu releases found, please contact OpenTofu', async () => { return null; }],
|
['latest', 'No tofu releases found, please contact OpenTofu', async () => {
|
||||||
['latest', 'No tofu releases found, please contact OpenTofu', async () => { return []; }]
|
return null;
|
||||||
|
}],
|
||||||
|
['latest', 'No tofu releases found, please contact OpenTofu', async () => {
|
||||||
|
return [];
|
||||||
|
}]
|
||||||
]
|
]
|
||||||
)('unhappy path: getRelease(\'%s\') -> throw Error(\'%s\')', async (input, wantErrorMessage, mockFetchReleasesFn) => {
|
)('unhappy path: getRelease(\'%s\') -> throw Error(\'%s\')', async (input, wantErrorMessage, mockFetchReleasesFn) => {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Generated
+26
-20
@@ -17,7 +17,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vercel/ncc": "0.38.1",
|
"@vercel/ncc": "0.38.1",
|
||||||
"husky": "8.0.3",
|
"husky": "9.0.11",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"semistandard": "17.0.0"
|
"semistandard": "17.0.0"
|
||||||
}
|
}
|
||||||
@@ -1777,12 +1777,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/braces": {
|
"node_modules/braces": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fill-range": "^7.0.1"
|
"fill-range": "^7.1.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@@ -2023,10 +2024,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.6",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
|
||||||
"integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
|
"integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"path-key": "^3.1.0",
|
"path-key": "^3.1.0",
|
||||||
"shebang-command": "^2.0.0",
|
"shebang-command": "^2.0.0",
|
||||||
@@ -2999,10 +3001,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/fill-range": {
|
"node_modules/fill-range": {
|
||||||
"version": "7.0.1",
|
"version": "7.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"to-regex-range": "^5.0.1"
|
"to-regex-range": "^5.0.1"
|
||||||
},
|
},
|
||||||
@@ -3361,15 +3364,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/husky": {
|
"node_modules/husky": {
|
||||||
"version": "8.0.3",
|
"version": "9.0.11",
|
||||||
"resolved": "https://registry.npmjs.org/husky/-/husky-8.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/husky/-/husky-9.0.11.tgz",
|
||||||
"integrity": "sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==",
|
"integrity": "sha512-AB6lFlbwwyIqMdHYhwPe+kjOC3Oc5P3nThEoW/AaO2BX3vJDjWPFxYLxokUZOo6RNX20He3AaT8sESs9NJcmEw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"husky": "lib/bin.js"
|
"husky": "bin.mjs"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/typicode"
|
"url": "https://github.com/sponsors/typicode"
|
||||||
@@ -3661,6 +3664,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",
|
||||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.12.0"
|
"node": ">=0.12.0"
|
||||||
}
|
}
|
||||||
@@ -4714,12 +4718,13 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/micromatch": {
|
"node_modules/micromatch": {
|
||||||
"version": "4.0.5",
|
"version": "4.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||||
"integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
|
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"braces": "^3.0.2",
|
"braces": "^3.0.3",
|
||||||
"picomatch": "^2.3.1"
|
"picomatch": "^2.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -5907,6 +5912,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",
|
||||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-number": "^7.0.0"
|
"is-number": "^7.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vercel/ncc": "0.38.1",
|
"@vercel/ncc": "0.38.1",
|
||||||
"husky": "8.0.3",
|
"husky": "9.0.11",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"semistandard": "17.0.0"
|
"semistandard": "17.0.0"
|
||||||
},
|
},
|
||||||
|
|||||||
+6
-5
@@ -33,13 +33,14 @@ async function checkTofu () {
|
|||||||
const args = process.argv.slice(2);
|
const args = process.argv.slice(2);
|
||||||
const options = {
|
const options = {
|
||||||
listeners,
|
listeners,
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true,
|
||||||
|
silent: true // don't print "[command...]" into stdout: https://github.com/actions/toolkit/issues/649
|
||||||
};
|
};
|
||||||
const exitCode = await exec(pathToCLI, args, options);
|
const exitCode = await exec(pathToCLI, args, options);
|
||||||
core.debug(`OpenTofu exited with code ${exitCode}.`);
|
|
||||||
core.debug(`stdout: ${stdout.contents}`);
|
// Pass-through stdout/err as `exec` won't due to `silent: true` option
|
||||||
core.debug(`stderr: ${stderr.contents}`);
|
process.stdout.write(stdout.contents);
|
||||||
core.debug(`exitcode: ${exitCode}`);
|
process.stderr.write(stderr.contents);
|
||||||
|
|
||||||
// Set outputs, result, exitcode, and stderr
|
// Set outputs, result, exitcode, and stderr
|
||||||
core.setOutput('stdout', stdout.contents);
|
core.setOutput('stdout', stdout.contents);
|
||||||
|
|||||||
Reference in new issue
Block a user