Skip to content

Commit

Permalink
fix(deps): update dependency eslint-plugin-github to v5; fix issues: …
Browse files Browse the repository at this point in the history
…add i18n support (#54)

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: MaxymVlasov <MaxymVlasov@users.noreply.github.com>
  • Loading branch information
renovate[bot] and MaxymVlasov authored Jan 25, 2025
1 parent c92486c commit 91fc39b
Show file tree
Hide file tree
Showing 8 changed files with 10,041 additions and 5,946 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"extends": ["plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
"ecmaVersion": 2020,
"sourceType": "module",
"project": "./tsconfig.json"
},
Expand Down
29 changes: 19 additions & 10 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,37 @@ const exec = __importStar(__nccwpck_require__(5236));
const github = __importStar(__nccwpck_require__(3228));
const strip_ansi_1 = __importDefault(__nccwpck_require__(348));
const fs_1 = __importDefault(__nccwpck_require__(9896));
const en = __importStar(__nccwpck_require__(4349));
function format(output) {
const ret = ['**The container image has inefficient files.**'];
const ret = [en.inefficientFiles];
let summarySection = false;
let inefficientFilesSection = false;
let resultSection = false;
for (const line of output.split('\n')) {
if (line.includes('Analyzing image')) {
if (line.includes(en.analyzingImage)) {
summarySection = true;
inefficientFilesSection = false;
resultSection = false;
ret.push('### Summary');
ret.push(en.summary);
}
else if (line.includes('Inefficient Files:')) {
else if (line.includes(en.inefficientFilesHeader)) {
summarySection = false;
inefficientFilesSection = true;
resultSection = false;
ret.push('### Inefficient Files');
ret.push(en.inefficientFilesSection);
}
else if (line.includes('Results:')) {
else if (line.includes(en.resultsHeader)) {
summarySection = false;
inefficientFilesSection = false;
resultSection = true;
ret.push('### Results');
ret.push(en.results);
}
else if (summarySection || resultSection) {
ret.push((0, strip_ansi_1.default)(line));
}
else if (inefficientFilesSection) {
if (line.startsWith('Count')) {
ret.push('| Count | Wasted Space | File Path |');
if (line.startsWith(en.countHeaderPrefix)) {
ret.push(en.countHeader);
ret.push('|---|---|---|');
}
else {
Expand Down Expand Up @@ -144,7 +145,7 @@ function run() {
const octokit = github.getOctokit(token);
const comment = Object.assign(Object.assign({}, github.context.issue), { issue_number: github.context.issue.number, body: format(output) });
yield octokit.rest.issues.createComment(comment);
core.setFailed(`Scan failed (exit code: ${exitCode})`);
core.setFailed(`${en.scanFailed} (exit code: ${exitCode})`);
}
catch (error) {
core.setFailed(error instanceof Error ? error.message : String(error));
Expand Down Expand Up @@ -31989,6 +31990,14 @@ function stripAnsi(string) {
}


/***/ }),

/***/ 4349:
/***/ ((module) => {

"use strict";
module.exports = /*#__PURE__*/JSON.parse('{"inefficientFiles":"**The container image has inefficient files.**","summary":"### Summary","inefficientFilesSection":"### Inefficient Files","results":"### Results","countHeader":"| Count | Wasted Space | File Path |","analyzingImage":"Analyzing image","inefficientFilesHeader":"Inefficient Files:","resultsHeader":"Results:","countHeaderPrefix":"Count","scanFailed":"Scan failed"}');

/***/ })

/******/ });
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 91fc39b

Please sign in to comment.