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

Template: PR branch name? #131

Closed
svanzoest opened this issue Jan 24, 2018 · 1 comment · Fixed by #164
Closed

Template: PR branch name? #131

svanzoest opened this issue Jan 24, 2018 · 1 comment · Fixed by #164

Comments

@svanzoest
Copy link

Hi,

Based on the data test fixtures, it seems like this might be tricky, but I would love to be able to have access to the branch name, so I could post process it in template to create the CHANGELOG.

I couldn't find if this was available currrently.

@alexcanessa
Copy link
Member

Hi @svanzoest the only problem with this task is that right now we're using the issue API to get PRs (as a pull_request is - technically - an issue).

The Solution:

  1. Call the get single PR when the issue has been identified as PR:
    _filterIssue(issue) {
    const { dataSource } = this.options;
    return (issue.pull_request ? dataSource === 'prs' : dataSource === 'issues' | dataSource === 'milestones') && !this._lablesAreIgnored(issue.labels) &&
    !((this.options.onlyMilestones || dataSource === 'milestones') && !issue.milestone);
    }
  2. Pass the branch information to the template function:
    _templateIssue(issue) {
    return generate({
    labels: this._templateLabels(issue),
    name: issue.title,
    text: '#' + issue.number,
    url: issue.html_url
    }, this.options.template.issue);
    }

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

Successfully merging a pull request may close this issue.

2 participants