@@ -4,7 +4,6 @@ import { WebClient } from "@slack/web-api";
4
4
5
5
async function run ( ) {
6
6
try {
7
- // Read GitHub context from the JSON file
8
7
const githubContextPath = process . argv [ 2 ] ;
9
8
if ( ! githubContextPath || ! fs . existsSync ( githubContextPath ) ) {
10
9
console . error ( 'GitHub context file missing or not provided' ) ;
@@ -14,7 +13,6 @@ async function run() {
14
13
const contextData = fs . readFileSync ( githubContextPath , 'utf8' ) ;
15
14
const context = JSON . parse ( contextData ) ;
16
15
17
- console . log ( 'Parsed GitHub Context:' , context ) ;
18
16
19
17
const event = context . event || { } ;
20
18
const comment = event . comment || { } ;
@@ -26,12 +24,12 @@ async function run() {
26
24
process . exit ( 1 ) ;
27
25
}
28
26
29
- // Bounty command regex
27
+
30
28
const bountyRegex = / \/ b o u n t y \s + \$ ( \d + ) / ;
31
29
const match = comment . body . match ( bountyRegex ) ;
32
30
33
31
if ( ! match ) {
34
- console . log ( 'No bounty command found' ) ;
32
+ // console.log('No bounty command found');
35
33
return ;
36
34
}
37
35
@@ -43,7 +41,7 @@ async function run() {
43
41
const github = new Octokit ( { auth : process . env . PERSONAL_ACCESS_TOKEN } ) ;
44
42
const slack = new WebClient ( process . env . SLACK_BOT_TOKEN ) ;
45
43
46
- // Retrieve existing labels
44
+
47
45
const { data : labels } = await github . issues . listLabelsOnIssue ( {
48
46
owner : repoOwner ,
49
47
repo : repoName ,
@@ -81,15 +79,15 @@ async function run() {
81
79
console . error ( 'Label Update Error:' , labelError ) ;
82
80
}
83
81
84
- // Track the number of developers the user has sponsored
82
+
85
83
const sponsorshipHistory = { } ;
86
84
if ( ! sponsorshipHistory [ commenter ] ) {
87
85
sponsorshipHistory [ commenter ] = 1 ;
88
86
} else {
89
87
sponsorshipHistory [ commenter ] += 1 ;
90
88
}
91
89
92
- // Find existing bounty comment
90
+
93
91
const { data : comments } = await github . issues . listComments ( {
94
92
owner : repoOwner ,
95
93
repo : repoName ,
@@ -129,7 +127,7 @@ async function run() {
129
127
console . error ( 'Slack Notification Error:' , slackError ) ;
130
128
}
131
129
132
- console . log ( `Bounty processed: $${ bountyAmount } added by ${ commenter } ` ) ;
130
+ // console.log(`Bounty processed: $${bountyAmount} added by ${commenter}`);
133
131
} catch ( error ) {
134
132
console . error ( 'Bounty Bot Unexpected Error:' , error ) ;
135
133
process . exit ( 1 ) ;
0 commit comments