How to use the @actions/core/lib/command.issue function in @actions/core

To help you get started, we’ve selected a few @actions/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RichiCoder1 / vault-action / action.js View on Github external
const requestOptions = {
            headers: {
                'X-Vault-Token': vaultToken
            }};

        if (vaultNamespace != null){
            requestOptions.headers["X-Vault-Namespace"] = vaultNamespace
        }

        const result = await got(`${vaultUrl}/v1/secret/data/${secretPath}`, requestOptions);

        const parsedResponse = JSON.parse(result.body);
        const vaultKeyData = parsedResponse.data;
        const versionData = vaultKeyData.data;
        const value = versionData[secretKey];
        command.issue('add-mask', value);
        core.exportVariable(outputName, `${value}`);
        core.debug(`✔ ${secretPath} => ${outputName}`);
    }
};