<commit_before>const cloudinary = require('cloudinary').v2;
const fs = require('fs');
const path = require('path');

module.exports = async ({ github, context }) => {
    const rootDir = path.resolve(path.join(__dirname, '..'));
    let commentBody = `###Functional Test Failure 🙀! (${context.workflow} / ${context.job.name})\n`;

    // Return "https" URLs by setting secure: true
    cloudinary.config({
        secure: true,
    });

    const uploadImages = async () => {
        let promiseArray = [];

        let images = fs.readdirSync(`${rootDir}/var/error-screenshots/`);

        images.forEach((element) => {
            console.log('uploading image to cloudinary..');

            let uplaodedImagePromise = cloudinary.uploader.upload(
                `${rootDir}/var/error-screenshots/${element}`,
                {
                    tags: 'ci,github-actions,e2e,screenshot',
                    folder: `solidinvoice/ci/errors/${context.issue.number}/${context.sha}`,
                    sign_url: true,
                    use_filename: true,
                    unique_filename: false,
                    overwrite: true,
                }
            );
            promiseArray.push(uplaodedImagePromise);
        });

        const urlList = await Promise.all(promiseArray);

        return urlList.map((element) => ({
            url: element.url,
            name: element.original_filename,
        }));
    };

    const urlList = await uploadImages();

    urlList.forEach((element) => {
        commentBody += `**element.name**\n![screenshot-${element.name}](${element.url}) \n`;
    });

    if (fs.existsSync(`${rootDir}/var/log/test.log`)) {
        const logFileContent = fs.readFileSync(`${rootDir}/var/log/test.log`);

        commentBody += `\n ### Log File\n \`\`\`${logFileContent}\`\`\``;
    }

    github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        body: `

        ${commentBody}
        `,
    });
};
<commit_msg>Fix variable name and spacinf gor comment<commit_after>const cloudinary = require('cloudinary').v2;
const fs = require('fs');
const path = require('path');

module.exports = async ({ github, context }) => {
    const rootDir = path.resolve(path.join(__dirname, '..'));
    let commentBody = `###Functional Test Failure 🙀! (${context.workflow} / ${context.job.name})\n`;

    // Return "https" URLs by setting secure: true
    cloudinary.config({
        secure: true,
    });

    const uploadImages = async () => {
        let promiseArray = [];

        let images = fs.readdirSync(`${rootDir}/var/error-screenshots/`);

        images.forEach((element) => {
            console.log('uploading image to cloudinary..');

            let uplaodedImagePromise = cloudinary.uploader.upload(
                `${rootDir}/var/error-screenshots/${element}`,
                {
                    tags: 'ci,github-actions,e2e,screenshot',
                    folder: `solidinvoice/ci/errors/${context.issue.number}/${context.sha}`,
                    sign_url: true,
                    use_filename: true,
                    unique_filename: false,
                    overwrite: true,
                }
            );
            promiseArray.push(uplaodedImagePromise);
        });

        const urlList = await Promise.all(promiseArray);

        return urlList.map((element) => ({
            url: element.url,
            name: element.original_filename,
        }));
    };

    const urlList = await uploadImages();

    urlList.forEach((element) => {
        commentBody += `**${element.name}**\n![screenshot-${element.name}](${element.url}) \n`;
    });

    if (fs.existsSync(`${rootDir}/var/log/test.log`)) {
        const logFileContent = fs.readFileSync(`${rootDir}/var/log/test.log`);

        commentBody += `\n ### Log File\n \`\`\`${logFileContent}\`\`\``;
    }

    github.rest.issues.createComment({
        issue_number: context.issue.number,
        owner: context.repo.owner,
        repo: context.repo.repo,
        body: commentBody,
    });
};

{'fraction_non_alphanumeric': 0.15895323479525078, 'fraction_numerical': 0.000969227041434456, 'mean_word_length': 2.108433734939759, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3063009', 'n_tokens_mistral': 1235, 'n_tokens_neox': 1184, 'n_words': 208}