INNER CODE UNIT · JavaScript
getComment
mlocati/docker-php-extension-installer · actions/check-new-issue/src/main.js:69
async function getComment(version, versionLine, token)
{
let prefix = '';
if (versionLine !== '') {
prefix = '> ' + [
VERSION_PREVLINE,
'',
versionLine,
].join('\n> ') + '\n\n'
}
const octokit = github.getOctokit(token);
const { owner, repo } = github.context.repo;
const { data: latestRelease } = await octokit.rest.repos.getLatestRelease({owner, repo});
const latestVersion = latestRelease.tag_name.replace(/^(v\.?)?/, '');
console.log(`Latest version: ${latestVersion}`);
if (version !== latestVersion) {
return prefix + `@${github.context.actor} the \`install-php-extensions\` version that you specified (\`${version}\`) is not the most recent one (\`${latestVersion}\`).\n\nHave you checked whether your issue still persists in the very latest version of \`install-php-extensions\`?`;
}