How to use the @actions/core.group 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 steenbergen-design / trellis-action / index.js View on Github external
function deploy_site(site_name, site, site_env){
    // Make sure site folder exists. We're already in the trellis folder so this should work fine.
    const ansible_site_path = site.local_path;
    if (fs.existsSync(site_path) && !fs.existsSync(ansible_site_path) ) {
        // Just symlink the directories together so ansible can find it.
        console.log(`Symlink ${site_path} to ${ansible_site_path}`);
        try {
            fs.symlinkSync(site_path, ansible_site_path);
        } catch (error) {
            core.error(`Symlinkin ${site_path} to ${ansible_site_path} failed: ${error.message}`);
        }
    } 

    core.group(`Deploy Site ${site_name}`, async () => {
        const deploy = await run_playbook(site_name, site_env, process.env['GITHUB_SHA']);
        return deploy;
    });
}