Skip to content

Template: PR branch name? #131

Closed

Description

@svanzoest

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.

Activity

  1. alexcanessa commented on Jan 24, 2018

    @alexcanessa
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions