Skip to content

Commit

Permalink
fix no description provided error
Browse files Browse the repository at this point in the history
  • Loading branch information
jun3453 committed Mar 4, 2020
1 parent 533fff3 commit 737efb9
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 58 deletions.
112 changes: 56 additions & 56 deletions SlackPrNotification.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
"use strict";
exports.__esModule = true;
var axios_1 = require("axios");
var url = process.env.SLACK_WEBHOOK_URL;
var prNum = process.env.PULL_REQUEST_NUMBER;
var prTitle = process.env.PULL_REQUEST_TITLE;
var prUrl = process.env.PULL_REQUEST_URL;
var prBody = process.env.PULL_REQUEST_BODY;
var authorName = process.env.PULL_REQUEST_AUTHOR_NAME;
var authorIconUrl = process.env.PULL_REQUEST_AUTHOR_ICON_URL;
var compareBranchName = process.env.PULL_REQUEST_COMPARE_BRANCH_NAME;
var baseBranchName = process.env.PULL_REQUEST_BASE_BRANCH_NAME;
var sendHereMention = process.env.IS_SEND_HERE_MENTION ? "<!here>\n" : "";
var message = {
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: sendHereMention + "*<" + prUrl + "|" + prTitle + ">*"
},
accessory: {
type: "image",
image_url: authorIconUrl,
alt_text: "github icon"
},
fields: [
{
type: "mrkdwn",
text: "*Author*\n" + authorName
},
{
type: "mrkdwn",
text: "*Base branch*\n" + baseBranchName
},
{
type: "mrkdwn",
text: "*Pull request number*\n#" + prNum
},
{
type: "mrkdwn",
text: "*Compare branch*\n" + compareBranchName
},
]
},
{
type: "section",
text: {
type: "plain_text",
text: prBody,
emoji: true
}
},
]
};
axios_1["default"].post(url, message);
"use strict";
exports.__esModule = true;
var axios_1 = require("axios");
var url = process.env.SLACK_WEBHOOK_URL;
var prNum = process.env.PULL_REQUEST_NUMBER;
var prTitle = process.env.PULL_REQUEST_TITLE;
var prUrl = process.env.PULL_REQUEST_URL;
var prBody = process.env.PULL_REQUEST_BODY || "No decription provided.";
var authorName = process.env.PULL_REQUEST_AUTHOR_NAME;
var authorIconUrl = process.env.PULL_REQUEST_AUTHOR_ICON_URL;
var compareBranchName = process.env.PULL_REQUEST_COMPARE_BRANCH_NAME;
var baseBranchName = process.env.PULL_REQUEST_BASE_BRANCH_NAME;
var sendHereMention = process.env.IS_SEND_HERE_MENTION ? "<!here>\n" : "";
var message = {
blocks: [
{
type: "section",
text: {
type: "mrkdwn",
text: sendHereMention + "*<" + prUrl + "|" + prTitle + ">*"
},
accessory: {
type: "image",
image_url: authorIconUrl,
alt_text: "github icon"
},
fields: [
{
type: "mrkdwn",
text: "*Author*\n" + authorName
},
{
type: "mrkdwn",
text: "*Base branch*\n" + baseBranchName
},
{
type: "mrkdwn",
text: "*Pull request number*\n#" + prNum
},
{
type: "mrkdwn",
text: "*Compare branch*\n" + compareBranchName
},
]
},
{
type: "section",
text: {
type: "plain_text",
text: prBody,
emoji: true
}
},
]
};
axios_1["default"].post(url, message);
4 changes: 2 additions & 2 deletions SlackPrNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const url: string = process.env.SLACK_WEBHOOK_URL;
const prNum: string = process.env.PULL_REQUEST_NUMBER;
const prTitle: string = process.env.PULL_REQUEST_TITLE;
const prUrl: string = process.env.PULL_REQUEST_URL;
const prBody: string = process.env.PULL_REQUEST_BODY;
const prBody: string = process.env.PULL_REQUEST_BODY || "No decription provided.";
const authorName: string = process.env.PULL_REQUEST_AUTHOR_NAME;
const authorIconUrl: string = process.env.PULL_REQUEST_AUTHOR_ICON_URL;
const compareBranchName: string = process.env.PULL_REQUEST_COMPARE_BRANCH_NAME;
Expand Down Expand Up @@ -49,7 +49,7 @@ const message: Object = {
type: "section",
text: {
type: "plain_text",
text: `${prBody}`,
text: prBody,
emoji: true,
},
},
Expand Down

0 comments on commit 737efb9

Please sign in to comment.