Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .github/workflows/npm-gulp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ name: NodeJS with Gulp

on:
push:
branches: [ master ]
branches: [ develop ]
paths: ["gulpfile.js"]
pull_request:
branches: [ master ]
branches: [ develop ]
paths: ["gulpfile.js"]

jobs:
build:
Expand All @@ -25,4 +27,4 @@ jobs:
- name: Build
run: |
npm install
gulp
gulp --tasks
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules


78 changes: 78 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
const gulp = require("gulp");
const axios = require("axios");

gulp.task("createnotification", async () => {
const options = {
blocks: [
{
type: "header",
text: {
type: "plain_text",
text: ":sparkles: New pull request for manual review on github actions",
emoji: true,
},
},
{
type: "context",
elements: [
{
text: `<@null> <@null> <@null> | *get-paid* | *null}* `,
type: "mrkdwn",
},
],
},
{
type: "divider",
},
{
type: "section",
text: {
type: "mrkdwn",
text: `*<https://bitbucket.org/payclick/get-paid/pull-requests>*`,
},
},
{
type: "section",
text: {
type: "mrkdwn",
text: `sample from from github`,
},
},
{
type: "actions",
elements: [
{
type: "button",
text: {
type: "plain_text",
emoji: true,
text: "Review Changes",
},
style: "primary",
url: "https://staging--getpaidafrica.netlify.app//",
},
{
type: "button",
text: {
type: "plain_text",
emoji: true,
text: "View Pull Request",
},
url: `https://bitbucket.org/payclick/get-paid/pull-requests`,
},
],
},
],
};

axios
.post(`${process.argv[4]}`, JSON.stringify(options))
.then((response) => {
console.log("SUCCEEDED: Sent slack webhook", response.data);
resolve(response.data);
})
.catch((error) => {
console.log("FAILED: Send slack webhook: \n", error);
reject(new Error("FAILED: Send slack webhook"));
});
});
Loading