Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 4 additions & 2 deletions .github/workflows/npm-gulp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ jobs:
run: npm install

- name: gulp
run: npm install -g gulp axios
run: npm install -g gulp axios @octokit/core

- name: notify
run: gulp createnotification --b ${{ secrets.SLACK_WEBHOOK_URL }}
# run: gulp createnotification --b ${{ secrets.SLACK_WEBHOOK_URL }}
run: gulp getpulls --b ${{ secrets.TOKEN }}

11 changes: 10 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const gulp = require("gulp");
const axios = require("axios");
const { Octokit } = require("@octokit/core");

gulp.task("createnotification", async () => {
const options = {
Expand Down Expand Up @@ -64,7 +65,6 @@ gulp.task("createnotification", async () => {
},
],
};

axios
.post(`${process.argv[4]}`, JSON.stringify(options))
.then((response) => {
Expand All @@ -76,3 +76,12 @@ gulp.task("createnotification", async () => {
reject(new Error("FAILED: Send slack webhook"));
});
});

gulp.task("getpulls", async () => {
const octokit = new Octokit({ auth: process.argv[4] });
const pulls = await octokit.request("GET /repos/bmsteven/demo/pulls", {
owner: "bmsteven",
repo: "demo",
});
console.log(pulls);
});
Loading