You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: project-assigner/dist/index.js
+31-20Lines changed: 31 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -20077,25 +20077,29 @@ async function handleLabeled(octokit, projectName, projectColumnId, labelToMatch
20077
20077
}
20078
20078
20079
20079
console.log(`Creating a new card for ${state} ${contentType} #${contentId} in project [${projectName}] column ${projectColumnId} mathing label [${labelToMatch}], labeled by ${github.context.payload.sender.login}`);
Copy file name to clipboardExpand all lines: project-assigner/index.js
+31-20Lines changed: 31 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -18,25 +18,29 @@ async function handleLabeled(octokit, projectName, projectColumnId, labelToMatch
18
18
}
19
19
20
20
console.log(`Creating a new card for ${state}${contentType} #${contentId} in project [${projectName}] column ${projectColumnId} mathing label [${labelToMatch}], labeled by ${github.context.payload.sender.login}`);
21
-
octokit.projects.createCard({
22
-
column_id: projectColumnId,
23
-
content_id: contentId,
24
-
content_type: contentType
25
-
}).then(function(response){
21
+
try{
22
+
constresponse=awaitoctokit.projects.createCard({
23
+
column_id: projectColumnId,
24
+
content_id: contentId,
25
+
content_type: contentType
26
+
});
26
27
console.log(`${contentType} #${contentId} added to project ${projectName} column ${projectColumnId}`);
27
-
}).catch(function(error){
28
+
}catch(error){
28
29
core.setFailed(`Error adding ${contentType} #${contentId} to project ${projectName} column ${projectColumnId}: ${error.message}`);
29
-
});
30
+
};
31
+
}else{
32
+
console.log(`No project assignments are configured for label ${labelToMatch}`);
0 commit comments