Check for changelog and/or pull contents from changelog using remote origin #55
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.
As it turns out, while you can use
git show {ref}:{filename}
to both test for the existing of a file at a given reference, as well as display its contents, it only works if the reference is present.When the github action starts, it exports the default branch to the working directory. Our code then fetches from the remote, which then sets the current branch to the default branch, which may or may not be the branch we are releasing from. It's not until we do a checkout operation that the release branch can be guaranteed as a reference in the checkout.
The reference does exist in the
origin
remote, and since we have all history, that means the content is present in our checkout; it's just that the reference doesn't exist IN the checkout.As such, for idempotent operations where we are checking for the existence of a file, or pulling its contents, we need to qualify the reference with the remote name (e.g.,
{remote}/1.0.x
). Since we can guarantee that theorigin
remote is present, we can use that remote name.Fixes #51