How to use the @actions/core.setSecret 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 Azure / webapps-deploy / src / deploymentProvider / WebAppDeploymentProvider.ts View on Github external
let res;
        await parseString(pubxmlFile, (error, result) => {
            if(!!error) {
                throw new Error("Failed XML parsing " + error);
            }
            res = result.publishData.publishProfile[0].$;
        });

        let creds: scmCredentials = {
            uri: res.publishUrl.split(":")[0],
            username: res.userName,
            password: res.userPWD
        };
        
        // masking kudu password
        core.setSecret('${creds.password}');

        if(creds.uri.indexOf("scm") < 0) {
            throw new Error("Publish profile does not contain kudu URL");
        }

        creds.uri = `https://${creds.uri}`;

        // setting application url
        this.applicationURL = res.destinationAppUrl;
        return creds;
    }
}
github aws-actions / configure-aws-credentials / index.js View on Github external
}

    // AWS_DEFAULT_REGION and AWS_REGION:
    // Specifies the AWS Region to send requests to
    core.exportVariable('AWS_DEFAULT_REGION', region);
    core.exportVariable('AWS_REGION', region);

    // Get the AWS account ID
    const sts = new aws.STS({
      customUserAgent: 'configure-aws-credentials-for-github-actions'
    });
    const identity = await sts.getCallerIdentity().promise();
    const accountId = identity.Account;
    core.setOutput('aws-account-id', accountId);
    if (!maskAccountId || maskAccountId.toLowerCase() == 'true') {
      core.setSecret(accountId);
    }
  }
  catch (error) {
    core.setFailed(error.message);
  }
}
github say8425 / aws-secrets-manager-actions / index.js View on Github external
Object.entries(parsedSecret).forEach(([key, value]) => {
      core.setSecret(value)
      core.exportVariable(key, value)
    })
  } else {