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

Feat: Ability to Grab Issues from Other GitHub Repos #4

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

omgitsbillryan
Copy link

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.

@omgitsbillryan
Copy link
Author

@peter-murray what do you think?

Copy link
Owner

@peter-murray peter-murray left a 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('/');
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants