Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick patch Fix #38 #40

Merged
merged 2 commits into from
Oct 15, 2020
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
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,12 @@ Any public or private repository can run this workflow by copying [greet_with_jo
## Usage

```yaml
name: "Greet With A Joke"
on: [issues,pull_request]
name: "Greet With A Random Joke"
on:
issues:
types: [opened, reopened]
pull_request:
types: [opened, reopened]

jobs:
test:
Expand All @@ -99,9 +103,10 @@ jobs:
- name: checkout
uses: actions/checkout@v2
- name: mast joke mara
uses: deep5050/MastjokeMara@main
uses: deep5050/MastJokeMara@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

````


Expand Down
13 changes: 6 additions & 7 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ const github_token = core.getInput('GITHUB_TOKEN');
const context = github.context;

const owner = context.payload.sender.login;
const repoOwner = context.payload.repository.owner.login;

if (owner.includes("[bot]")) {
console.log("Avoiding bot comments....");
if (owner.includes("[bot]") || owner === repoOwner) {
console.log("Avoiding issues /PR opened by bot / Owner....");
process.exit(0);
}

Expand Down Expand Up @@ -62,12 +63,10 @@ async function run(joke) {
console.log(`Running on ${event}......`);



// console.log(`eventname: ${github.context.eventName}`)
// console.log(`payload sender: ${JSON.stringify(github.context.payload.sender, undefined, 2)}`)
// console.log(`eventname: ${github.context.eventName}`)
// console.log(`payload sender: ${JSON.stringify(github.context.payload.sender, undefined, 2)}`)
// console.log(`workflow: ${github.context.workflow}`)
// console.log(`payload: ${JSON.stringify(github.context.payload, undefined, 2)}`)

// console.log(`payload: ${JSON.stringify(github.context.payload, undefined, 2)}`)


var issueNumber;
Expand Down
12 changes: 8 additions & 4 deletions greet_with_joke.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: "Greet With A Joke"
on: [issues,pull_request]
name: "Greet With A Random Joke"
on:
issues:
types: [opened, reopened]
pull_request:
types: [opened, reopened]

jobs:
test:
Expand All @@ -9,6 +13,6 @@ jobs:
- name: checkout
uses: actions/checkout@v2
- name: mast joke mara
uses: deep5050/MastjokeMara@main
uses: deep5050/MastJokeMara@main
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ const github_token = core.getInput('GITHUB_TOKEN');
const context = github.context;

const owner = context.payload.sender.login;
const repoOwner = context.payload.repository.owner.login;

if (owner.includes("[bot]")) {
console.log("Avoiding bot comments....");
if (owner.includes("[bot]") || owner === repoOwner) {
console.log("Avoiding issues/PR opened by bot/repo owner....");
process.exit(0);
}

Expand Down Expand Up @@ -55,10 +56,10 @@ async function run(joke) {
console.log(`Running on ${event}......`);


// console.log(`eventname: ${github.context.eventName}`)
// console.log(`payload sender: ${JSON.stringify(github.context.payload.sender, undefined, 2)}`)
// console.log(`eventname: ${github.context.eventName}`)
// console.log(`payload sender: ${JSON.stringify(github.context.payload.sender, undefined, 2)}`)
// console.log(`workflow: ${github.context.workflow}`)
// console.log(`payload: ${JSON.stringify(github.context.payload, undefined, 2)}`)
// console.log(`payload: ${JSON.stringify(github.context.payload, undefined, 2)}`)


var issueNumber;
Expand Down