Only consider commits before commitish
, if provided
#1058
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #1053
When searching for commits to be included in the release notes, if
commitish
is supplied, it is first resolved to a commit sha. That commit sha is then used a starting point for the graphql query. This allows us to generalize the process and support both "static" (commits, tags) and "dynamic" (branches)commitish
values.This does not affect
target_commitish
of the release, which will always be the value provided, with no modifications.Demo repository is here:
https://github.com/mikeroll/release-drafter-1053/releases
https://github.com/mikeroll/release-drafter-1053/actions
Each of the 4 actions correspond to release-drafter configured differently. Added @jetersen to contributors if you want to play around, any of those actions may be restarted to see the different behaviours.
no-commitish
- uses the repository's default branch, as before. The action is for an old commit, but even if re-run it will include all the later commits in the release, as before.commitish-as-branch
- same as above, with the branch specified explicitly.commitish-as-sha{,-2}
- the sha of the commit being built (${{ github.sha }}
) is set as the release target (already worked before) and only the commits up to and including this one are included in the release notes, i.e. the build for commit 3 does not add commit 4.