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

Set onlyLastTag to true to prevent rate limiting issues w/ gh api #668

Merged
merged 1 commit into from
Oct 20, 2021

Conversation

jkremser
Copy link
Member

if the flag is true, it should translate to this logic: https://github.com/heinrichreimer/action-github-changelog-generator/blob/master/entrypoint.sh#L27

when evaluated that command locally it returned correctly the previous tag, so this should work 🤞

What may go wrong is the previous gh checkout action not fetching all the tags, but fetch-depth: 0 (as it is) should fetch everything, I am mentioning it in here so that we are aware that it may break if someone change that number to say 1

Signed-off-by: Jirka Kremser [email protected]

kuritka
kuritka previously approved these changes Oct 19, 2021
ytsarev
ytsarev previously approved these changes Oct 19, 2021
somaritane
somaritane previously approved these changes Oct 19, 2021
Copy link
Collaborator

@k0da k0da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It the same time, PR opened by this workflow will drop old changes

@jkremser
Copy link
Member Author

jkremser commented Oct 19, 2021

It the same time, PR opened by this workflow will drop old changes

ah, so the result is not additive and instead it will override the changelog? Hmm bummer, then we need to sprinkle it w/ some bash-fu and append logic, I guess.

@k0da
Copy link
Collaborator

k0da commented Oct 19, 2021

It is enough to change file name to generate and then insert step between those two jobs and append new to the old. create PR step will detect changes then.

@jkremser jkremser dismissed stale reviews from somaritane, ytsarev, and kuritka via 163560b October 20, 2021 11:35
@jkremser jkremser force-pushed the changelog-lasttag-only branch from c3fc992 to 163560b Compare October 20, 2021 11:35
- name: Prepend the latest changes to CHANGELOG.md
run: |
mv CHANGELOG.md CHANGELOG-old.md
cat CHANGELOG-latest.md | sed -e'$d' > CHANGELOG.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the last line w/ the footer ("This Changelog was automatically generated by...") it would be in the middle of the file otherwise

run: |
mv CHANGELOG.md CHANGELOG-old.md
cat CHANGELOG-latest.md | sed -e'$d' > CHANGELOG.md
cat CHANGELOG-old.md | sed -e'1,4d' >> CHANGELOG.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the first couple of lines w/ the # Changelog\n\n (again, it would be in the middle of the file otherwise)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't these statements belong to comment right in the code?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, sorry. I've missed your comment, fair point. Do you want me to open the pr just with the comments?

@jkremser jkremser merged commit 04757b6 into k8gb-io:master Oct 20, 2021
@jkremser jkremser deleted the changelog-lasttag-only branch October 20, 2021 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants