mirror of
https://github.com/hashicorp/setup-terraform.git
synced 2025-12-17 17:02:36 +00:00
Merge branch 'main' into use-tool-versions
This commit is contained in:
commit
bf31c69041
23 changed files with 4601 additions and 4960 deletions
|
|
@ -7,6 +7,7 @@
|
|||
const fs = require('fs').promises;
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const semver = require('semver');
|
||||
|
||||
// External
|
||||
const core = require('@actions/core');
|
||||
|
|
@ -165,7 +166,15 @@ async function run () {
|
|||
core.debug(`Finding releases for Terraform version ${version}`);
|
||||
const release = await releases.getRelease('terraform', version, 'GitHub Action: Setup Terraform');
|
||||
const platform = mapOS(osPlatform);
|
||||
const arch = mapArch(osArch);
|
||||
let arch = mapArch(osArch);
|
||||
|
||||
// Terraform was not available for darwin/arm64 until 1.0.2, however macOS
|
||||
// runners can emulate darwin/amd64.
|
||||
if (platform === 'darwin' && arch === 'arm64' && semver.valid(release.version) && semver.lt(release.version, '1.0.2')) {
|
||||
core.warning('Terraform is not available for darwin/arm64 until version 1.0.2. Falling back to darwin/amd64.');
|
||||
arch = 'amd64';
|
||||
}
|
||||
|
||||
core.debug(`Getting build for Terraform version ${release.version}: ${platform} ${arch}`);
|
||||
const build = release.getBuild(platform, arch);
|
||||
if (!build) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue