mirror of
https://github.com/hashicorp/vault-action.git
synced 2026-04-10 14:10:09 +00:00
update got dependency and convert to esm module (#533)
* update require got to import got * convert remaining to esm * wip: replace jest with vitest * fix test imports and vitest config * remove dist package.json * fix import in ent test * add dist * move actions/core to prod dependency * remove unused import that was breaking esm compilation * simplify imports * use module.createRequire to import jsonata * add doc link comment * add comments on import insanity * add more comments * update PR tempalte * bump got and remove jest deps * revert debug npm run command * fix fs import * simplify vitest config for each test suite
This commit is contained in:
parent
a727ce205a
commit
77efb36ae3
39 changed files with 12213 additions and 14317 deletions
|
|
@ -1,7 +1,11 @@
|
|||
const jsonata = require("jsonata");
|
||||
const { WILDCARD } = require("./constants");
|
||||
const { normalizeOutputKey } = require("./utils");
|
||||
const core = require('@actions/core');
|
||||
import core from '@actions/core';
|
||||
import { WILDCARD } from './constants.js';
|
||||
import { normalizeOutputKey } from './utils.js';
|
||||
|
||||
// ncc doesn't compile jsonata imports properly, so we must use our own custom require
|
||||
import require from "./cjs-require.js";
|
||||
const jsonata = require('jsonata');
|
||||
|
||||
|
||||
/**
|
||||
* @typedef {Object} SecretRequest
|
||||
|
|
@ -44,7 +48,7 @@ async function getSecrets(secretRequests, client, ignoreNotFound) {
|
|||
} catch (error) {
|
||||
const {response} = error;
|
||||
if (response?.statusCode === 404) {
|
||||
notFoundMsg = `Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`;
|
||||
let notFoundMsg = `Unable to retrieve result for "${path}" because it was not found: ${response.body.trim()}`;
|
||||
const ignoreNotFound = (core.getInput('ignoreNotFound', { required: false }) || 'false').toLowerCase() != 'false';
|
||||
if (ignoreNotFound) {
|
||||
core.error(`✘ ${notFoundMsg}`);
|
||||
|
|
@ -165,7 +169,7 @@ const selectAndAppendResults = async (
|
|||
];
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
export {
|
||||
getSecrets,
|
||||
selectData
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue