mirror of
https://github.com/opentofu/setup-opentofu.git
synced 2025-12-31 15:02:19 +00:00
Compare commits
20 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e95ccdd206 | ||
|
|
04ba7507e2 | ||
|
|
720194ca9d | ||
|
|
4738a2ed5e | ||
|
|
bbaf94fb8f | ||
|
|
dc6f440014 | ||
|
|
8ff58c1228 | ||
|
|
339b7b2a1b | ||
|
|
5e2b22fba4 | ||
|
|
dd259403c5 | ||
|
|
5a7ce099f4 | ||
|
|
58cf7f7458 | ||
|
|
1631e5f6a3 | ||
|
|
82a7ffce68 | ||
|
|
9cc1438d52 | ||
|
|
d23989bcfc | ||
|
|
868f16c8cb | ||
|
|
9fc82761c6 | ||
|
|
b16e63e2c6 | ||
|
|
0f0911fca8 |
10 changed files with 56566 additions and 5808 deletions
10
.github/workflows/continuous-integration.yml
vendored
10
.github/workflows/continuous-integration.yml
vendored
|
|
@ -1,4 +1,4 @@
|
|||
name: 'Continuous Integration'
|
||||
name: "Continuous Integration"
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -9,11 +9,11 @@ on:
|
|||
jobs:
|
||||
check-dist:
|
||||
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:
|
||||
node-version: "20.x"
|
||||
node-version: "20.19.1"
|
||||
test:
|
||||
name: Test
|
||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@967035ce963867fb956a309c9b67512314bc7c1f
|
||||
uses: actions/reusable-workflows/.github/workflows/basic-validation.yml@2826fb8353263a138210fc017301ce5767a9c0d4
|
||||
with:
|
||||
node-version: "20.x"
|
||||
node-version: "20.19.1"
|
||||
|
|
|
|||
|
|
@ -4,4 +4,9 @@
|
|||
# We currently do not have any specific code owners
|
||||
# In the future, we will have a Github team of global code owners of the entire package
|
||||
# Later on, we will start splitting up the responsibilities, and packages will be assigned more specific code owners
|
||||
# * @opentofu-code-owners
|
||||
* @opentofu/maintainers
|
||||
|
||||
# The last matching pattern takes the most precedence for CODEOWNERS. CODEOWNERS does not have fine-grained control so we will
|
||||
# just match whole changes for these specific files, but @diofeher is responsible for taking care of the Dependabot updates
|
||||
# in this repository.
|
||||
package*.json @diofeher
|
||||
|
|
|
|||
31823
dist/index.js
vendored
31823
dist/index.js
vendored
File diff suppressed because one or more lines are too long
27011
dist/index1.js
vendored
27011
dist/index1.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -28,21 +28,26 @@ class Release {
|
|||
* @return {Array<Release>} Releases.
|
||||
*/
|
||||
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 headers = {
|
||||
Accept: 'application/json'
|
||||
};
|
||||
|
||||
const resp = await fetch(url, {
|
||||
headers
|
||||
});
|
||||
const resp = await http.get(url, headers);
|
||||
|
||||
if (!resp.ok) {
|
||||
throw new Error('failed fetching releases (' + resp.status + ')');
|
||||
if (resp.message.statusCode !== hc.HttpCodes.OK) {
|
||||
throw new Error('failed fetching releases (' + resp.message.statusCode + ')');
|
||||
}
|
||||
|
||||
const releasesMeta = await resp.json();
|
||||
const body = await resp.readBody();
|
||||
const releasesMeta = JSON.parse(body);
|
||||
|
||||
/**
|
||||
* @type {Array}
|
||||
*/
|
||||
|
|
|
|||
3427
package-lock.json
generated
3427
package-lock.json
generated
File diff suppressed because it is too large
Load diff
16
package.json
16
package.json
|
|
@ -19,16 +19,16 @@
|
|||
"keywords": [],
|
||||
"author": "",
|
||||
"dependencies": {
|
||||
"@actions/core": "1.10.1",
|
||||
"@actions/exec": "1.1.1",
|
||||
"@actions/io": "1.1.3",
|
||||
"@actions/tool-cache": "2.0.1",
|
||||
"semver": "7.5.4"
|
||||
"@actions/core": "2.0.1",
|
||||
"@actions/exec": "2.0.0",
|
||||
"@actions/io": "2.0.0",
|
||||
"@actions/tool-cache": "2.0.2",
|
||||
"semver": "7.7.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/ncc": "0.38.1",
|
||||
"husky": "9.0.11",
|
||||
"jest": "29.7.0",
|
||||
"@vercel/ncc": "0.38.4",
|
||||
"husky": "9.1.7",
|
||||
"jest": "30.2.0",
|
||||
"semistandard": "17.0.0"
|
||||
},
|
||||
"semistandard": {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,8 @@
|
|||
*
|
||||
* @example
|
||||
* // Instantiate a new listener
|
||||
* const listener = new OutputListener();
|
||||
* // stream is used to write the data before waiting for the listener to complete
|
||||
* const listener = new OutputListener(stream);
|
||||
* // Register listener against STDOUT stream
|
||||
* await exec.exec('ls', ['-ltr'], {
|
||||
* listeners: {
|
||||
|
|
@ -20,12 +21,14 @@
|
|||
* console.log(listener.contents);
|
||||
*/
|
||||
class OutputListener {
|
||||
constructor () {
|
||||
constructor (stream) {
|
||||
this._buff = [];
|
||||
this._stream = stream;
|
||||
}
|
||||
|
||||
get listener () {
|
||||
const listen = function listen (data) {
|
||||
this._stream.write(data);
|
||||
this._buff.push(data);
|
||||
};
|
||||
return listen.bind(this);
|
||||
|
|
|
|||
|
|
@ -4,14 +4,18 @@
|
|||
*/
|
||||
|
||||
const OutputListener = require('../lib/output-listener');
|
||||
|
||||
const { PassThrough } = require('stream');
|
||||
describe('output-listener', () => {
|
||||
it('receives and exposes data', () => {
|
||||
const listener = new OutputListener();
|
||||
const stream = new PassThrough();
|
||||
const listener = new OutputListener(stream);
|
||||
const listen = listener.listener;
|
||||
listen(Buffer.from('foo'));
|
||||
expect(stream.read()).toEqual(Buffer.from('foo'));
|
||||
listen(Buffer.from('bar'));
|
||||
expect(stream.read()).toEqual(Buffer.from('bar'));
|
||||
listen(Buffer.from('baz'));
|
||||
expect(stream.read()).toEqual(Buffer.from('baz'));
|
||||
expect(listener.contents).toEqual('foobarbaz');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ async function checkTofu () {
|
|||
await checkTofu();
|
||||
|
||||
// Create listeners to receive output (in memory) as well
|
||||
const stdout = new OutputListener();
|
||||
const stderr = new OutputListener();
|
||||
const stdout = new OutputListener(process.stdout);
|
||||
const stderr = new OutputListener(process.stderr);
|
||||
const listeners = {
|
||||
stdout: stdout.listener,
|
||||
stderr: stderr.listener
|
||||
|
|
@ -38,10 +38,6 @@ async function checkTofu () {
|
|||
};
|
||||
const exitCode = await exec(pathToCLI, args, options);
|
||||
|
||||
// Pass-through stdout/err as `exec` won't due to `silent: true` option
|
||||
process.stdout.write(stdout.contents);
|
||||
process.stderr.write(stderr.contents);
|
||||
|
||||
// Set outputs, result, exitcode, and stderr
|
||||
core.setOutput('stdout', stdout.contents);
|
||||
core.setOutput('stderr', stderr.contents);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue