mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2025-12-31 15:02:19 +00:00
fix: #45 Add HTTP proxy support (#65)
Some checks failed
Continuous Integration / Check dist/ directory (push) Has been cancelled
Continuous Integration / Test (push) Has been cancelled
Setup OpenTofu / OpenTofu Version Files (push) Has been cancelled
Setup OpenTofu / OpenTofu Versions (push) Has been cancelled
Setup OpenTofu / OpenTofu Arguments (push) Has been cancelled
Setup OpenTofu / OpenTofu Run Local (push) Has been cancelled
Setup OpenTofu / OpenTofu Cloud Credentials (push) Has been cancelled
Setup OpenTofu / OpenTofu Enterprise Credentials (push) Has been cancelled
Setup OpenTofu / OpenTofu No Credentials (push) Has been cancelled
Some checks failed
Continuous Integration / Check dist/ directory (push) Has been cancelled
Continuous Integration / Test (push) Has been cancelled
Setup OpenTofu / OpenTofu Version Files (push) Has been cancelled
Setup OpenTofu / OpenTofu Versions (push) Has been cancelled
Setup OpenTofu / OpenTofu Arguments (push) Has been cancelled
Setup OpenTofu / OpenTofu Run Local (push) Has been cancelled
Setup OpenTofu / OpenTofu Cloud Credentials (push) Has been cancelled
Setup OpenTofu / OpenTofu Enterprise Credentials (push) Has been cancelled
Setup OpenTofu / OpenTofu No Credentials (push) Has been cancelled
Signed-off-by: Devin <hoopysoup@users.noreply.github.com>
This commit is contained in:
parent
dd259403c5
commit
5e2b22fba4
4 changed files with 994 additions and 2690 deletions
4
.github/workflows/continuous-integration.yml
vendored
4
.github/workflows/continuous-integration.yml
vendored
|
|
@ -9,11 +9,11 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
check-dist:
|
check-dist:
|
||||||
name: Check dist/ directory
|
name: Check dist/ directory
|
||||||
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@967035ce963867fb956a309c9b67512314bc7c1f
|
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@2826fb8353263a138210fc017301ce5767a9c0d4
|
||||||
with:
|
with:
|
||||||
node-version: "20.x"
|
node-version: "20.x"
|
||||||
test:
|
test:
|
||||||
name: Test
|
name: Test
|
||||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@967035ce963867fb956a309c9b67512314bc7c1f
|
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@2826fb8353263a138210fc017301ce5767a9c0d4
|
||||||
with:
|
with:
|
||||||
node-version: "20.x"
|
node-version: "20.x"
|
||||||
|
|
|
||||||
2646
dist/index.js
vendored
2646
dist/index.js
vendored
File diff suppressed because it is too large
Load diff
1011
dist/index1.js
vendored
1011
dist/index1.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -28,21 +28,26 @@ class Release {
|
||||||
* @return {Array<Release>} Releases.
|
* @return {Array<Release>} Releases.
|
||||||
*/
|
*/
|
||||||
async function fetchReleases (githubToken) {
|
async function fetchReleases (githubToken) {
|
||||||
|
const hc = require('@actions/http-client');
|
||||||
|
const userAgent = 'opentofu/setup-opentofu';
|
||||||
|
|
||||||
|
const http = new hc.HttpClient(userAgent);
|
||||||
|
|
||||||
const url = 'https://get.opentofu.org/tofu/api.json';
|
const url = 'https://get.opentofu.org/tofu/api.json';
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
Accept: 'application/json'
|
Accept: 'application/json'
|
||||||
};
|
};
|
||||||
|
|
||||||
const resp = await fetch(url, {
|
const resp = await http.get(url, headers);
|
||||||
headers
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!resp.ok) {
|
if (resp.message.statusCode !== hc.HttpCodes.OK) {
|
||||||
throw new Error('failed fetching releases (' + resp.status + ')');
|
throw new Error('failed fetching releases (' + resp.message.statusCode + ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
const releasesMeta = await resp.json();
|
let body = await resp.readBody();
|
||||||
|
const releasesMeta = JSON.parse(body);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Array}
|
* @type {Array}
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue