Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
RamanaReddy0M committed Jul 25, 2024
1 parent adb2cc5 commit 4aee4d3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
15 changes: 12 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6791,6 +6791,13 @@ var __webpack_exports__ = {};
// ESM COMPAT FLAG
__nccwpck_require__.r(__webpack_exports__);

// NAMESPACE OBJECT: ./src/yaml.js
var yaml_namespaceObject = {};
__nccwpck_require__.r(yaml_namespaceObject);
__nccwpck_require__.d(yaml_namespaceObject, {
"I": () => (generateGithubReportFile)
});

// EXTERNAL MODULE: ./node_modules/@actions/core/lib/core.js
var core = __nccwpck_require__(2186);
// EXTERNAL MODULE: ./node_modules/@actions/exec/lib/exec.js
Expand Down Expand Up @@ -10747,15 +10754,17 @@ const GITHUB_REPOSITORY_OWNER = process.env.GITHUB_REPOSITORY_OWNER;
const GITHUB_REPOSITORY = process.env.GITHUB_REPOSITORY.replace(`${GITHUB_REPOSITORY_OWNER}/`, '');
const GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE;

async function generateGithubReportFile(token, reportConfigFileName = 'default-github-report.yaml') {
const DEFAULT_GITHUB_REPORT_CONFIG = 'default-github-report.yaml';

async function generateGithubReportFile(token, reportConfigFileName = DEFAULT_GITHUB_REPORT_CONFIG) {
const gitHubRepoConfig = {
username: GITHUB_ACTOR,
owner: GITHUB_REPOSITORY_OWNER,
token,
"project-name": GITHUB_REPOSITORY,
};

const isDefaultConfig = reportConfigFileName === 'default-github-report.yaml';
const isDefaultConfig = reportConfigFileName === DEFAULT_GITHUB_REPORT_CONFIG;

let content = {};

Expand Down Expand Up @@ -10878,7 +10887,7 @@ async function run() {
// create default config file with name `github-report.yaml`
console.log('Generating github report default`');
await generateGithubReportFile(githubToken);
params.push(`-rc=github-report.yaml`);
params.push(`-rc=${yaml_namespaceObject.DEFAULT_GITHUB_REPORT_CONFIG}`);
} else if (reportConfig && reportConfig.trim().length > 0) {
console.log('Generating github report with custom config: ', reportConfig);
await generateGithubReportFile(githubToken, reportConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as installer from './installer';
import { generateGithubReportFile } from './yaml';
import { generateGithubReportFile, DEFAULT_GITHUB_REPORT_CONFIG } from './yaml';
import { parseFlagsToArray } from './utils';
const fs = require('fs');

Expand Down Expand Up @@ -89,7 +89,7 @@ async function run() {
// create default config file with name `github-report.yaml`
console.log('Generating github report default`');
await generateGithubReportFile(githubToken);
params.push(`-rc=github-report.yaml`);
params.push(`-rc=${DEFAULT_GITHUB_REPORT_CONFIG}`);
} else if (reportConfig && reportConfig.trim().length > 0) {
console.log('Generating github report with custom config: ', reportConfig);
await generateGithubReportFile(githubToken, reportConfig);
Expand Down
6 changes: 4 additions & 2 deletions src/yaml.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ const GITHUB_REPOSITORY_OWNER = process.env.GITHUB_REPOSITORY_OWNER;
const GITHUB_REPOSITORY = process.env.GITHUB_REPOSITORY.replace(`${GITHUB_REPOSITORY_OWNER}/`, '');
const GITHUB_WORKSPACE = process.env.GITHUB_WORKSPACE;

export async function generateGithubReportFile(token, reportConfigFileName = 'default-github-report.yaml') {
const DEFAULT_GITHUB_REPORT_CONFIG = 'default-github-report.yaml';

export async function generateGithubReportFile(token, reportConfigFileName = DEFAULT_GITHUB_REPORT_CONFIG) {
const gitHubRepoConfig = {
username: GITHUB_ACTOR,
owner: GITHUB_REPOSITORY_OWNER,
token,
"project-name": GITHUB_REPOSITORY,
};

const isDefaultConfig = reportConfigFileName === 'default-github-report.yaml';
const isDefaultConfig = reportConfigFileName === DEFAULT_GITHUB_REPORT_CONFIG;

let content = {};

Expand Down

0 comments on commit 4aee4d3

Please sign in to comment.