Skip to content

Commit

Permalink
Remove summary link from bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Crabtree committed Oct 16, 2024
1 parent e5b7746 commit 3c0deca
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 2 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,17 +829,16 @@ const markdown_1 = __nccwpck_require__(2519);
const action_1 = __nccwpck_require__(2216);
const publishComment = (token, title, message, postNew) => __awaiter(void 0, void 0, void 0, function* () {
const context = getContext();
const { owner, repo, runId, issueNumber, commit } = context;
const { owner, repo, issueNumber, commit } = context;
if (!token || !owner || !repo || issueNumber === -1) {
(0, action_1.log)('Failed to post a comment');
return;
}
const header = (0, markdown_1.formatHeaderMarkdown)(title);
const octokit = (0, github_1.getOctokit)(token);
const existingComment = yield getExistingComment(octokit, context, header);
const summaryLink = (0, markdown_1.formatSummaryLinkMarkdown)(owner, repo, runId, title);
const footer = commit ? (0, markdown_1.formatFooterMarkdown)(commit) : '';
const body = `${header}${message}${summaryLink}${footer}`;
const body = `${header}${message}${footer}`;
if (existingComment && !postNew) {
yield octokit.rest.issues.updateComment({ owner, repo, comment_id: existingComment.id, body });
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions src/utils/comments.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { context, getOctokit } from '@actions/github/lib/github';
import { GitHub } from '@actions/github/lib/utils';
import { formatFooterMarkdown, formatHeaderMarkdown, formatSummaryLinkMarkdown } from '../formatting/markdown';
import { formatFooterMarkdown, formatHeaderMarkdown } from '../formatting/markdown';
import { log } from './action';

type Octokit = InstanceType<typeof GitHub>;
Expand All @@ -20,7 +20,7 @@ export const publishComment = async (
postNew: boolean
): Promise<void> => {
const context = getContext();
const { owner, repo, runId, issueNumber, commit } = context;
const { owner, repo, issueNumber, commit } = context;

if (!token || !owner || !repo || issueNumber === -1) {
log('Failed to post a comment');
Expand All @@ -31,9 +31,8 @@ export const publishComment = async (
const octokit = getOctokit(token);
const existingComment = await getExistingComment(octokit, context, header);

const summaryLink = formatSummaryLinkMarkdown(owner, repo, runId, title);
const footer = commit ? formatFooterMarkdown(commit) : '';
const body = `${header}${message}${summaryLink}${footer}`;
const body = `${header}${message}${footer}`;

if (existingComment && !postNew) {
await octokit.rest.issues.updateComment({ owner, repo, comment_id: existingComment.id, body });
Expand Down

0 comments on commit 3c0deca

Please sign in to comment.