-
Notifications
You must be signed in to change notification settings - Fork 45
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
Feature: Split PR & issues into separate events #272
Merged
PuneetGopinath
merged 10 commits into
Readme-Workflows:main
from
A2-NieR:feat/split-pr-events
May 2, 2023
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b6969a5
feat: split pr events
A2-NieR d072371
docs: update split pr events
A2-NieR 9f16f85
docs: update readme w/ new pr events
A2-NieR 5682e1a
docs: fix vscode auto toc update
A2-NieR ff277b5
feat: split issues into separate open/close events
A2-NieR 3edf457
fix: old serializer eventname
A2-NieR c2b5675
fix: refactor gh api event types
A2-NieR 6e22861
docs: update readme
A2-NieR 973fd4d
fix: update eventlist
A2-NieR 4886455
Merge branch 'main' into feat/split-pr-events
PuneetGopinath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { issue_closed } = require("../config"); | ||
const makeCustomUrl = require("../functions/makeCustomUrl"); | ||
const toUrlFormat = require("../functions/toUrlFormat"); | ||
|
||
const IssuesEvent = (item) => { | ||
if (item.payload.action === "closed") { | ||
return issue_closed | ||
.replace(/{ID}/g, toUrlFormat(item, "issue_close")) | ||
.replace(/{REPO}/g, toUrlFormat(item.repo.name, "issue_close")) | ||
.replace(/{URL}/g, makeCustomUrl(item, "issue_close")); | ||
} else { | ||
return ""; | ||
} | ||
}; | ||
|
||
module.exports = IssuesEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { pr_closed } = require("../config"); | ||
const makeCustomUrl = require("../functions/makeCustomUrl"); | ||
const toUrlFormat = require("../functions/toUrlFormat"); | ||
|
||
const PullRequestCloseEvent = (item) => { | ||
if (item.payload.action === "closed" && !item.payload.pull_request.merged) { | ||
return pr_closed | ||
.replace(/{ID}/g, toUrlFormat(item, "pr_close")) | ||
.replace(/{REPO}/g, toUrlFormat(item.repo.name, "pr_close")) | ||
.replace(/{URL}/g, makeCustomUrl(item, "pr_close")); | ||
} else { | ||
return ""; | ||
} | ||
}; | ||
module.exports = PullRequestCloseEvent; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { pr_merged } = require("../config"); | ||
const makeCustomUrl = require("../functions/makeCustomUrl"); | ||
const toUrlFormat = require("../functions/toUrlFormat"); | ||
|
||
const PullRequestMergeEvent = (item) => { | ||
if (item.payload.action === "merge") { | ||
return pr_merged | ||
.replace(/{ID}/g, toUrlFormat(item, "pr_merge")) | ||
.replace(/{REPO}/g, toUrlFormat(item.repo.name, "pr_merge")) | ||
.replace(/{URL}/g, makeCustomUrl(item, "pr_merge")); | ||
} else { | ||
return ""; | ||
} | ||
}; | ||
|
||
module.exports = PullRequestMergeEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { pr_opened } = require("../config"); | ||
const makeCustomUrl = require("../functions/makeCustomUrl"); | ||
const toUrlFormat = require("../functions/toUrlFormat"); | ||
|
||
const PullRequestOpenEvent = (item) => { | ||
if (item.payload.action === "opened") { | ||
return pr_opened | ||
.replace(/{ID}/g, toUrlFormat(item, "pr_open")) | ||
.replace(/{REPO}/g, toUrlFormat(item.repo.name, "pr_open")) | ||
.replace(/{URL}/g, makeCustomUrl(item, "pr_open")); | ||
} else { | ||
return ""; | ||
} | ||
}; | ||
|
||
module.exports = PullRequestOpenEvent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where the problem lies. GitHub API does not provide a type of the value "IssuesOpenEvent" or the other new names that you have made. Due to this change, while testing I see that none of the issue and pull request-related events are shown in the profile.
You can checkout https://docs.github.com/en/developers/webhooks-and-events/github-event-types for the docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to modify the functions/filterContent.js file to use the respective serializers for their respective events
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I see, thanks for the info.
Rn I don't have the time, so I can close the PR until I can look into this if you want me to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to close the pr, let it be open. Whenever free you can look into the issue, that's not an problem.
We appreciate your efforts to contribute to Readme-Workflows!