Skip to content

Commit d714190

Browse files
committed
Added Actions And Removed Uneccesary Logs
1 parent fb66147 commit d714190

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/scripts/bounty.mjs

+6-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { WebClient } from "@slack/web-api";
44

55
async function run() {
66
try {
7-
// Read GitHub context from the JSON file
87
const githubContextPath = process.argv[2];
98
if (!githubContextPath || !fs.existsSync(githubContextPath)) {
109
console.error('GitHub context file missing or not provided');
@@ -14,7 +13,6 @@ async function run() {
1413
const contextData = fs.readFileSync(githubContextPath, 'utf8');
1514
const context = JSON.parse(contextData);
1615

17-
console.log('Parsed GitHub Context:', context);
1816

1917
const event = context.event || {};
2018
const comment = event.comment || {};
@@ -26,12 +24,12 @@ async function run() {
2624
process.exit(1);
2725
}
2826

29-
// Bounty command regex
27+
3028
const bountyRegex = /\/bounty\s+\$(\d+)/;
3129
const match = comment.body.match(bountyRegex);
3230

3331
if (!match) {
34-
console.log('No bounty command found');
32+
// console.log('No bounty command found');
3533
return;
3634
}
3735

@@ -43,7 +41,7 @@ async function run() {
4341
const github = new Octokit({ auth: process.env.PERSONAL_ACCESS_TOKEN });
4442
const slack = new WebClient(process.env.SLACK_BOT_TOKEN);
4543

46-
// Retrieve existing labels
44+
4745
const { data: labels } = await github.issues.listLabelsOnIssue({
4846
owner: repoOwner,
4947
repo: repoName,
@@ -81,15 +79,15 @@ async function run() {
8179
console.error('Label Update Error:', labelError);
8280
}
8381

84-
// Track the number of developers the user has sponsored
82+
8583
const sponsorshipHistory = {};
8684
if (!sponsorshipHistory[commenter]) {
8785
sponsorshipHistory[commenter] = 1;
8886
} else {
8987
sponsorshipHistory[commenter] += 1;
9088
}
9189

92-
// Find existing bounty comment
90+
9391
const { data: comments } = await github.issues.listComments({
9492
owner: repoOwner,
9593
repo: repoName,
@@ -129,7 +127,7 @@ async function run() {
129127
console.error('Slack Notification Error:', slackError);
130128
}
131129

132-
console.log(`Bounty processed: $${bountyAmount} added by ${commenter}`);
130+
// console.log(`Bounty processed: $${bountyAmount} added by ${commenter}`);
133131
} catch (error) {
134132
console.error('Bounty Bot Unexpected Error:', error);
135133
process.exit(1);

0 commit comments

Comments
 (0)