Skip to content

Commit e6d63e7

Browse files
committed
🔈 added-logging
1 parent db2dd17 commit e6d63e7

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

index.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,11 @@ async function asanaOperations(
99
sectionName,
1010
taskComment
1111
) {
12-
const client = asana.Client.create({
13-
defaultHeaders: { 'asana-enable': 'new-sections,string_ids' },
14-
logAsanaChangeWarnings: false
15-
}).useAccessToken(asanaPAT);
16-
1712
try {
13+
const client = asana.Client.create({
14+
defaultHeaders: { 'asana-enable': 'new-sections,string_ids' },
15+
logAsanaChangeWarnings: false
16+
}).useAccessToken(asanaPAT);
1817
if (sectionName) {
1918
let project = await client.sections.findByProject(projectId);
2019
if (project) {
@@ -36,7 +35,7 @@ async function asanaOperations(
3635
core.info('Added the pull request link to the Asana task.');
3736
}
3837
} catch (ex) {
39-
core.error(ex.value);
38+
console.error(ex.value);
4039
}
4140
}
4241

@@ -53,6 +52,9 @@ try {
5352
let taskComment = null,
5453
parseAsanaURL = null;
5554

55+
if (!ASANA_PAT){
56+
throw({message: "ASANA PAT Not Found!"});
57+
}
5658
if (TASK_COMMENT) {
5759
taskComment = `${TASK_COMMENT} ${PULL_REQUEST.html_url}`;
5860
}

0 commit comments

Comments
 (0)