Skip to content

related PRs is different when writing to a file #43

@leemeador

Description

@leemeador

In this place, where it collects the PRs from the subject line to write to the changelog file,

https://github.com/requarks/changelog-action/blob/main/index.js#L36

it will collect the PRS but NOT the rightmost (last) one from the subject line and the function buildSubject will return all but the last one.

A few lines down, when it is not writing to the changelog file, it collects all of the PRs in the subject line and returns all of them.

The PRs that are returned are used to build the "related issues" section(s).

Is it ignoring the last PR on the subject line when not writing on purpose or is it a mistake.

I am adapting your code with some modifications for our use and saw this when writing some tests and noticed this.

2nd Question:

The code in this line iterates over the PR refs in the subject line

https://github.com/requarks/changelog-action/blob/main/index.js#L42

but it is in an "else" clause that only runs if there are no PRs. So its equivalent to saying "output = subject"

It looks to me like you could rewrite that line (and remove the next lines) since it will never run. Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions