Skip to content
Merged
21 changes: 0 additions & 21 deletions .github/workflows/create_pull_request.yml

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/develop_actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: on merging to develop

on:
push:
branches: [ develop ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build
run: npm install

- name: install packages
run: npm install -g gulp axios @octokit/core @actions/github @actions/core
- uses: ./
with:
GITHUB_TOKEN: ${{secrets.TOKEN}}
18 changes: 0 additions & 18 deletions .github/workflows/merge_pull_request.yml

This file was deleted.

37 changes: 0 additions & 37 deletions .github/workflows/npm-gulp.yml

This file was deleted.

15 changes: 15 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: 'Automatically create pr to staging'
description: 'Run develop actions'
author: 'Benedict Steven'

inputs:
GITHUB_TOKEN:
description: 'GitHub Token'
required: true
runs:
using: 'node16'
main: './src/develop_actions.js'

branding:
icon: 'package'
color: 'gray-dark'
105 changes: 92 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@ gulp.task("getpulls", async () => {
});
console.log("pulls", pulls?.data);

const pull = await octokit.request("GET /repos/bmsteven/demo/pulls/16", {
const pull = await octokit.request("GET /repos/bmsteven/demo/pulls/18", {
owner: "bmsteven",
repo: "demo",
pull_number: "16",
pull_number: "18",
});
console.log("pull", pull?.data);
// update pull request
Expand All @@ -109,27 +109,27 @@ gulp.task("getpulls", async () => {
{
owner: "bmsteven",
repo: "demo",
pull_number: "16",
pull_number: "18",
}
);
console.log("commits", commits?.data);
// check if pull request was merged
// const checkPulls = await octokit.request(
// "GET /repos/bmsteven/demo/pulls/16/merge",
// {
// owner: "bmsteven",
// repo: "demo",
// pull_number: "16",
// }
// );
// console.log("checkPulls", checkPulls?.data);
const checkPulls = await octokit.request(
"GET /repos/bmsteven/demo/pulls/18/merge",
{
owner: "bmsteven",
repo: "demo",
pull_number: "18",
}
);
console.log("checkPulls", checkPulls?.data);
// merge pull request
const mergepr = await octokit.request(
"PUT /repos/bmsteven/demo/pulls/16/merge",
{
owner: "bmsteven",
repo: "demo",
pull_number: "16",
pull_number: "18",
}
);
console.log("mergepr", mergepr?.data);
Expand Down Expand Up @@ -163,3 +163,82 @@ gulp.task("getpulls", async () => {
// run: echo "This step will be skipped on Monday and Wednesday"
// - name: Every time
// run: echo "This step will always run"

// create pr action
// name: Pull Request Action
// on:
// push:
// branches:
// - feature/*
// - test/*
// - test

// jobs:
// create-pull-request:
// runs-on: ubuntu-latest
// steps:
// - name: Check out repository code
// uses: actions/checkout@v2
// - name: pull-request
// uses: repo-sync/pull-request@v2
// with:
// destination_branch: "develop"
// github_token: ${{ secrets.GITHUB_TOKEN }}
// pr_label: "feature, automated pr"
// pr_title: "[Example] Simple demo"

// name: test

// on:
// pull_request:
// branches: [master, develop, staging]

// jobs:
// build:
// runs-on: ubuntu-latest

// steps:
// - name: Check Out Repo
// uses: actions/checkout@v2

// # - name: 🔀 Merge Pull Request
// # uses: BaharaJr/merge-pr@0.0.1
// # with:
// # GITHUB_TOKEN: ${{ secrets.TOKEN }}

// name: NodeJS with Gulp

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

// jobs:
// build:
// runs-on: ubuntu-latest

// strategy:
// fail-fast: false
// matrix:
// node-version: [12.x, 14.x, 16.x]

// steps:
// - uses: actions/checkout@v3

// - name: Use Node.js ${{ matrix.node-version }}
// uses: actions/setup-node@v3
// with:
// node-version: ${{ matrix.node-version }}

// - name: Build
// run: npm install

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

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