Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ steps:
- name: Set up Enos
uses: hashicorp/action-setup-enos@v1
with:
version: 0.0.35 # You only need to specify a version if you wish to override the default version
version: 0.0.36 # You only need to specify a version if you wish to override the default version
```

## Inputs

The actions supports the following inputs:

- `version`: The version of `enos` to install, defaulting to `0.0.35`
- `version`: The version of `enos` to install, defaulting to `0.0.36`

## Release a new version of Enos

Expand Down
197 changes: 179 additions & 18 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6361,7 +6361,7 @@ const diff = (version1, version2) => {
return prefix + 'patch'
}

// high and low are preleases
// high and low are prereleases
return 'prerelease'
}

Expand Down Expand Up @@ -6968,8 +6968,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +

// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
// Non-numberic identifiers include numberic identifiers but can be longer.
// Therefore non-numberic identifiers must go first.
// Non-numeric identifiers include numeric identifiers but can be longer.
// Therefore non-numeric identifiers must go first.

createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
}|${src[t.NUMERICIDENTIFIER]})`)
Expand Down Expand Up @@ -7482,7 +7482,7 @@ const compare = __nccwpck_require__(8469)
// - If LT
// - If LT.semver is greater than any < or <= comp in C, return false
// - If LT is <=, and LT.semver does not satisfy every C, return false
// - If GT.semver has a prerelease, and not in prerelease mode
// - If LT.semver has a prerelease, and not in prerelease mode
// - If no C has a prerelease and the LT.semver tuple, return false
// - Else return true

Expand Down Expand Up @@ -39024,7 +39024,7 @@ function isKeyOperator(operator) {
function getValues(context, operator, key, modifier) {
var value = context[key], result = [];
if (isDefined(value) && value !== "") {
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
if (typeof value === "string" || typeof value === "number" || typeof value === "bigint" || typeof value === "boolean") {
value = value.toString();
if (modifier && modifier !== "*") {
value = value.substring(0, parseInt(modifier, 10));
Expand Down Expand Up @@ -39213,6 +39213,162 @@ var endpoint = withDefaults(null, DEFAULTS);

// EXTERNAL MODULE: ./node_modules/fast-content-type-parse/index.js
var fast_content_type_parse = __nccwpck_require__(1120);
;// CONCATENATED MODULE: ./node_modules/json-with-bigint/json-with-bigint.js
const intRegex = /^-?\d+$/;
const noiseValue = /^-?\d+n+$/; // Noise - strings that match the custom format before being converted to it
const originalStringify = JSON.stringify;
const originalParse = JSON.parse;
const customFormat = /^-?\d+n$/;

const bigIntsStringify = /([\[:])?"(-?\d+)n"($|([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;
const noiseStringify =
/([\[:])?("-?\d+n+)n("$|"([\\n]|\s)*(\s|[\\n])*[,\}\]])/g;

/** @typedef {(key: string, value: any, context?: { source: string }) => any} Reviver */

/**
* Function to serialize value to a JSON string.
* Converts BigInt values to a custom format (strings with digits and "n" at the end) and then converts them to proper big integers in a JSON string.
* @param {*} value - The value to convert to a JSON string.
* @param {(Function|Array<string>|null)} [replacer] - A function that alters the behavior of the stringification process, or an array of strings to indicate properties to exclude.
* @param {(string|number)} [space] - A string or number to specify indentation or pretty-printing.
* @returns {string} The JSON string representation.
*/
const JSONStringify = (value, replacer, space) => {
if ("rawJSON" in JSON) {
return originalStringify(
value,
(key, value) => {
if (typeof value === "bigint") return JSON.rawJSON(value.toString());

if (typeof replacer === "function") return replacer(key, value);

if (Array.isArray(replacer) && replacer.includes(key)) return value;

return value;
},
space,
);
}

if (!value) return originalStringify(value, replacer, space);

const convertedToCustomJSON = originalStringify(
value,
(key, value) => {
const isNoise =
typeof value === "string" && Boolean(value.match(noiseValue));

if (isNoise) return value.toString() + "n"; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing

if (typeof value === "bigint") return value.toString() + "n";

if (typeof replacer === "function") return replacer(key, value);

if (Array.isArray(replacer) && replacer.includes(key)) return value;

return value;
},
space,
);
const processedJSON = convertedToCustomJSON.replace(
bigIntsStringify,
"$1$2$3",
); // Delete one "n" off the end of every BigInt value
const denoisedJSON = processedJSON.replace(noiseStringify, "$1$2$3"); // Remove one "n" off the end of every noisy string

return denoisedJSON;
};

/**
* Support for JSON.parse's context.source feature detection.
* @type {boolean}
*/
const isContextSourceSupported = () =>
JSON.parse("1", (_, __, context) => !!context && context.source === "1");

/**
* Convert marked big numbers to BigInt
* @type {Reviver}
*/
const convertMarkedBigIntsReviver = (key, value, context, userReviver) => {
const isCustomFormatBigInt =
typeof value === "string" && value.match(customFormat);
if (isCustomFormatBigInt) return BigInt(value.slice(0, -1));

const isNoiseValue = typeof value === "string" && value.match(noiseValue);
if (isNoiseValue) return value.slice(0, -1);

if (typeof userReviver !== "function") return value;
return userReviver(key, value, context);
};

/**
* Faster (2x) and simpler function to parse JSON.
* Based on JSON.parse's context.source feature, which is not universally available now.
* Does not support the legacy custom format, used in the first version of this library.
*/
const JSONParseV2 = (text, reviver) => {
return JSON.parse(text, (key, value, context) => {
const isBigNumber =
typeof value === "number" &&
(value > Number.MAX_SAFE_INTEGER || value < Number.MIN_SAFE_INTEGER);
const isInt = context && intRegex.test(context.source);
const isBigInt = isBigNumber && isInt;

if (isBigInt) return BigInt(context.source);

if (typeof reviver !== "function") return value;

return reviver(key, value, context);
});
};

const MAX_INT = Number.MAX_SAFE_INTEGER.toString();
const MAX_DIGITS = MAX_INT.length;
const stringsOrLargeNumbers =
/"(?:\\.|[^"])*"|-?(0|[1-9][0-9]*)(\.[0-9]+)?([eE][+-]?[0-9]+)?/g;
const noiseValueWithQuotes = /^"-?\d+n+"$/; // Noise - strings that match the custom format before being converted to it

/**
* Function to parse JSON.
* If JSON has number values greater than Number.MAX_SAFE_INTEGER, we convert those values to a custom format, then parse them to BigInt values.
* Other types of values are not affected and parsed as native JSON.parse() would parse them.
*/
const JSONParse = (text, reviver) => {
if (!text) return originalParse(text, reviver);

if (isContextSourceSupported()) return JSONParseV2(text, reviver); // Shortcut to a faster (2x) and simpler version

// Find and mark big numbers with "n"
const serializedData = text.replace(
stringsOrLargeNumbers,
(text, digits, fractional, exponential) => {
const isString = text[0] === '"';
const isNoise = isString && Boolean(text.match(noiseValueWithQuotes));

if (isNoise) return text.substring(0, text.length - 1) + 'n"'; // Mark noise values with additional "n" to offset the deletion of one "n" during the processing

const isFractionalOrExponential = fractional || exponential;
const isLessThanMaxSafeInt =
digits &&
(digits.length < MAX_DIGITS ||
(digits.length === MAX_DIGITS && digits <= MAX_INT)); // With a fixed number of digits, we can correctly use lexicographical comparison to do a numeric comparison

if (isString || isFractionalOrExponential || isLessThanMaxSafeInt)
return text;

return '"' + text + 'n"';
},
);

return originalParse(serializedData, (key, value, context) =>
convertMarkedBigIntsReviver(key, value, context, reviver),
);
};



;// CONCATENATED MODULE: ./node_modules/@octokit/request-error/dist-src/index.js
class RequestError extends Error {
name;
Expand Down Expand Up @@ -39262,7 +39418,7 @@ class RequestError extends Error {


// pkg/dist-src/version.js
var dist_bundle_VERSION = "10.0.7";
var dist_bundle_VERSION = "10.0.8";

// pkg/dist-src/defaults.js
var defaults_default = {
Expand All @@ -39274,6 +39430,7 @@ var defaults_default = {
// pkg/dist-src/fetch-wrapper.js



// pkg/dist-src/is-plain-object.js
function dist_bundle_isPlainObject(value) {
if (typeof value !== "object" || value === null) return false;
Expand All @@ -39296,7 +39453,7 @@ async function fetchWrapper(requestOptions) {
}
const log = requestOptions.request?.log || console;
const parseSuccessResponseBody = requestOptions.request?.parseSuccessResponseBody !== false;
const body = dist_bundle_isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSON.stringify(requestOptions.body) : requestOptions.body;
const body = dist_bundle_isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body) ? JSONStringify(requestOptions.body) : requestOptions.body;
const requestHeaders = Object.fromEntries(
Object.entries(requestOptions.headers).map(([name, value]) => [
name,
Expand Down Expand Up @@ -39395,7 +39552,7 @@ async function getResponseData(response) {
let text = "";
try {
text = await response.text();
return JSON.parse(text);
return JSONParse(text);
} catch (err) {
return text;
}
Expand Down Expand Up @@ -39790,8 +39947,11 @@ var light = __nccwpck_require__(3251);
var plugin_retry_dist_bundle_VERSION = "0.0.0-development";

// pkg/dist-src/error-request.js
function isRequestError(error) {
return error.request !== void 0;
}
async function errorRequest(state, octokit, error, options) {
if (!error.request || !error.request.request) {
if (!isRequestError(error) || !error?.request.request) {
throw error;
}
if (error.status >= 400 && !state.doNotRetry.includes(error.status)) {
Expand All @@ -39808,8 +39968,8 @@ async function errorRequest(state, octokit, error, options) {
async function wrapRequest(state, octokit, request, options) {
const limiter = new light();
limiter.on("failed", function(error, info) {
const maxRetries = ~~error.request.request.retries;
const after = ~~error.request.request.retryAfter;
const maxRetries = ~~error.request.request?.retries;
const after = ~~error.request.request?.retryAfter;
options.request.retryCount = info.retryCount + 1;
if (maxRetries > info.retryCount) {
return after * state.retryAfterBaseValue;
Expand All @@ -39821,7 +39981,7 @@ async function wrapRequest(state, octokit, request, options) {
);
}
async function requestWithGraphqlErrorHandling(state, octokit, request, options) {
const response = await request(request, options);
const response = await request(options);
if (response.data && response.data.errors && response.data.errors.length > 0 && /Something went wrong while executing your query/.test(
response.data.errors[0].message
)) {
Expand All @@ -39845,11 +40005,7 @@ function retry(octokit, octokitOptions) {
},
octokitOptions.retry
);
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, state, octokit));
octokit.hook.wrap("request", wrapRequest.bind(null, state, octokit));
}
return {
const retryPlugin = {
retry: {
retryRequest: (error, retries, retryAfter) => {
error.request.request = Object.assign({}, error.request.request, {
Expand All @@ -39860,6 +40016,11 @@ function retry(octokit, octokitOptions) {
}
}
};
if (state.enabled) {
octokit.hook.error("request", errorRequest.bind(null, state, retryPlugin));
octokit.hook.wrap("request", wrapRequest.bind(null, state, retryPlugin));
}
return retryPlugin;
}
retry.VERSION = plugin_retry_dist_bundle_VERSION;

Expand Down Expand Up @@ -50276,7 +50437,7 @@ const executableName = "enos";
const gitHubRepositoryOwner = "hashicorp";
const gitHubRepositoryRepo = "enos";

const latestVersion = "0.0.35";
const latestVersion = "0.0.36";

async function downloadReleaseAsset(client, releaseAsset, directory) {
try {
Expand Down
25 changes: 25 additions & 0 deletions dist/licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,31 @@ The above copyright notice and this permission notice shall be included in all c
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


json-with-bigint
MIT
MIT License

Copyright (c) 2023 Ivan Korolenko

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.


keyv
MIT
MIT License
Expand Down
Loading
Loading