Skip to content

Commit

Permalink
Merge pull request #6 from ALJAZEERAPLUS/feature/pull-request-link
Browse files Browse the repository at this point in the history
Add pull request link button
  • Loading branch information
vhsantos26 committed Aug 12, 2022
2 parents 8d6210a + adab6cb commit 3829757
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28160,6 +28160,7 @@ async function generateSlackMessage(text) {
];

if (reportLink) {
core.info('Adding report link.');
attachments[0].actions.push(
{
"type": "button",
Expand All @@ -28169,12 +28170,13 @@ async function generateSlackMessage(text) {
)
};

if (github.context.event_name === 'pull_request') {
attachments[0].fields.push(
if (github.context.eventName === 'pull_request') {
core.info('Adding pull request link.');
attachments[0].actions.push(
{
"type": "button",
"text": "Pull Request",
"url": github.context.event.pull_request._links.html.href
"url": github.context.payload.pull_request.html_url
}
)
};
Expand Down
8 changes: 5 additions & 3 deletions src/send-slack-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ async function generateSlackMessage(text) {
];

if (reportLink) {
core.info('Adding report link.');
attachments[0].actions.push(
{
"type": "button",
Expand All @@ -148,12 +149,13 @@ async function generateSlackMessage(text) {
)
};

if (github.context.event_name === 'pull_request') {
attachments[0].fields.push(
if (github.context.eventName === 'pull_request') {
core.info('Adding pull request link.');
attachments[0].actions.push(
{
"type": "button",
"text": "Pull Request",
"url": github.context.event.pull_request._links.html.href
"url": github.context.payload.pull_request.html_url
}
)
};
Expand Down

0 comments on commit 3829757

Please sign in to comment.