Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency eslint-plugin-github to v5; fix issues: add i18n support #54

Merged
merged 3 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading