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

fix: github discussions references #20

Merged
merged 2 commits into from
Dec 14, 2023

Conversation

danieldietzler
Copy link
Member

No description provided.

package.json Show resolved Hide resolved
if (response.status === 200) {
const type = response.data.pull_request ? 'PR' : 'ISSUE';
links.add(`[${type}] ${response.data.title} ([#${id}](${response.data.html_url}))`);
const type = response.data.pull_request ? 'PR' : 'ISSUE';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all the try/catch stuff looks a bit messy to me. Maybe you could:

  • If no matches, continue (and de-indent everything - top of the for loop)
  • Move the github requests to private functions that return a string or null.
  • Update the for loop to just be const link = await this.getIssueOrPR(id) || await this.getDiscussion(id);

@danieldietzler danieldietzler force-pushed the fix/github-discussions-references branch from 86c6e18 to 88bb3ce Compare December 14, 2023 20:41
@danieldietzler danieldietzler merged commit fc4babc into main Dec 14, 2023
3 checks passed
@danieldietzler danieldietzler deleted the fix/github-discussions-references branch December 14, 2023 20:47
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.

3 participants