-
Notifications
You must be signed in to change notification settings - Fork 5
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
Feat: Ability to Grab Issues from Other GitHub Repos #4
base: main
Are you sure you want to change the base?
Feat: Ability to Grab Issues from Other GitHub Repos #4
Conversation
Feat/target gh repository
@peter-murray what do you think? |
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.
Thank you for this, I have only one suggestion around the validation on the input from a user and prefer to fail early with a nicer error to the user if they make a mistake in passing in a repository (i.e. not in the full name form).
@@ -9,9 +9,11 @@ module.exports = class IssueUtil { | |||
this.octokit = github.getOctokit(token); | |||
} | |||
|
|||
getIssueBody(id) { | |||
getIssueBody(id, repository) { | |||
const [owner, repo] = repository.split('/'); |
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.
My only issue here is that it is possible for a user to provide an input that is not in this form and we would not detect this of fail nicely with the following call.
I would suggest that we validate the repository
input early in the execution when we obtain that value from the user inputs and pass a consistent {owner: '', repo: ''} object to this function.
Adds a
repository
param to allow the user to specify the repository where the GitHub issue is located. Allows for fetching issues from repos other than where the workflow was executed from.