diff --git a/README.md b/README.md index 1b57f88..8e782b8 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ jobs: - name: Checkout uses: actions/checkout@v3 with: - fetch-depth: 0 # required to detect changed files + fetch-depth: 2 # required to detect changed files ref: ${{ github.event.pull_request.head.sha }} - name: Run tests @@ -49,7 +49,7 @@ jobs: ```yaml -- uses: sidx1024/report-nyc-coverage-github-action@v1.1 +- uses: sidx1024/report-nyc-coverage-github-action@v1.0.0 with: # Path to coverage output directory generated by "nyc report". coverage_output_directory: "" diff --git a/dist/index.js b/dist/index.js index 0c19957..28fb2aa 100644 --- a/dist/index.js +++ b/dist/index.js @@ -10044,9 +10044,9 @@ async function run() { const commentTemplateMDPath = path.resolve(core.getInput(ActionInput.comment_template_file)); const commentTemplate = fs.readFileSync(commentTemplateMDPath, { encoding: 'utf-8' }); - let commentBody = replaceTokens(commentTemplate, outputs); - const commentMark = ``; + const commentBody = replaceTokens(commentTemplate, outputs) + '\n' + commentMark + '\n'; + const commentMode = core.getInput(ActionInput.comment_mode); const octokit = await github.getOctokit(gitHubToken); @@ -10054,7 +10054,6 @@ async function run() { commentMode === 'replace' ? await findCommentByBody(octokit, commentMark) : null; if (existingComment) { - commentBody += '\n' + commentMark + '\n'; await octokit.rest.issues.updateComment({ owner: github.context.repo.owner, repo: github.context.repo.repo, @@ -10075,6 +10074,8 @@ async function run() { }); } +// dummy + async function getChangedFiles() { const { base, head } = github.context.payload.pull_request; const { exitCode, output } = await executeCommand( @@ -10128,7 +10129,6 @@ async function findCommentByBody(octokit, commentBodyIncludes) { } function getFilePrefix() { - console.log('github.context.payload.pull_request', github.context.payload.pull_request); return `../blob/${github.context.payload.pull_request.head.sha}/`; } diff --git a/src/index.js b/src/index.js index 92cbce3..f303bf0 100644 --- a/src/index.js +++ b/src/index.js @@ -75,9 +75,9 @@ async function run() { const commentTemplateMDPath = path.resolve(core.getInput(ActionInput.comment_template_file)); const commentTemplate = fs.readFileSync(commentTemplateMDPath, { encoding: 'utf-8' }); - let commentBody = replaceTokens(commentTemplate, outputs); - const commentMark = ``; + const commentBody = replaceTokens(commentTemplate, outputs) + '\n' + commentMark + '\n'; + const commentMode = core.getInput(ActionInput.comment_mode); const octokit = await github.getOctokit(gitHubToken); @@ -85,7 +85,6 @@ async function run() { commentMode === 'replace' ? await findCommentByBody(octokit, commentMark) : null; if (existingComment) { - commentBody += '\n' + commentMark + '\n'; await octokit.rest.issues.updateComment({ owner: github.context.repo.owner, repo: github.context.repo.repo, @@ -106,6 +105,8 @@ async function run() { }); } +// dummy + async function getChangedFiles() { const { base, head } = github.context.payload.pull_request; const { exitCode, output } = await executeCommand( @@ -159,7 +160,6 @@ async function findCommentByBody(octokit, commentBodyIncludes) { } function getFilePrefix() { - console.log('github.context.payload.pull_request', github.context.payload.pull_request); return `../blob/${github.context.payload.pull_request.head.sha}/`; }