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

Add token and ref input options #16

Merged
merged 3 commits into from Sep 8, 2022
Merged

Add token and ref input options #16

merged 3 commits into from Sep 8, 2022

Conversation

taiki-e
Copy link
Owner

@taiki-e taiki-e commented Sep 7, 2022

  • Add token input option to use the specified token instead of GITHUB_TOKEN environment variable.
  • Add ref input option to use the specified tag ref instead of GITHUB_REF environment variable.

Option names are from actions/checkout.

Closes #14
Partially replaces #15

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 7, 2022

cc @kirrg001: Is this enough to fix #14?

I'm not sure about the changelog format you mention in #15, but if a properly documented format exists, I think it is possible to have the parse-changelog support it. (Although I don't think a simple parsing in bash will work due to the complexity of markdown)

Also, I added you as the co-author of the second commit because you were working on a similar thing in #15.

@kirrg001
Copy link
Contributor

kirrg001 commented Sep 7, 2022

Yeah thanks a lot 👍 token and refs looks great

I'm not sure about the changelog format you mention in #15, but if a properly documented format exists, I think it is possible to have the parse-changelog support it. (Although I don't think a simple parsing in bash will work due to the complexity of markdown)

So yeah. The code I have shown was just a hack to see that it works. The parser did not work for me.

The parser would need to support the Lerna conventional changelog format which uses e.g. titles with anchors based on tags. Or the parser returned too many lines, which was unexpected (e.g. when the title was # 2.7.0 (2022-08-31)

See lerna changelog as an example. Lerna is using conventional changelog specification.

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 8, 2022

See lerna changelog as an example. Lerna is using conventional changelog specification.

Thanks for the info. The current parse-changelog requires all versions to have the same heading level (it does not care whether it is h2 or h3 or others), but the latest version of conventional-changelog does the same thing.

Therefore, changelogs following the latest conventional-changelog should already be supported by the parse-changelog.

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 8, 2022

Therefore, changelogs following the latest conventional-changelog should already be supported by the parse-changelog.

Hmm, conventional-changelog-conventionalcommits based on that rule has been released, but conventional-changelog does not seem to have been released yet? (conventional-changelog/conventional-changelog#940)

@kirrg001
Copy link
Contributor

kirrg001 commented Sep 8, 2022

It's good to hear that conventional changelog changed the heading to always H2. That is great.

We are somehow using an older version of conventional-changelog
conventional-changelog/conventional-changelog@3d79263

We will try to update to get the newer version to avoid having h1 headings. This is unrelated to this topic.

The parser would need to support the Lerna conventional changelog format which uses e.g. titles with anchors based on tags. Or the parser returned too many lines, which was unexpected (e.g. when the title was # 2.7.0 (2022-08-31)

Download our latest CHANGELOG and run:

Change heading for 2.7.0 to ##

$ parse-changelog ./CHANGELOG.md 2.7.0
error: not found release note for '2.7.0'

Change the 2.7.0 to ## 2.7.0 - 2022-08-31

$ parse-changelog ./CHANGELOG.md 2.7.0
....

Works

@taiki-e
Copy link
Owner Author

taiki-e commented Sep 8, 2022

Change heading for 2.7.0 to ##

$ parse-changelog ./CHANGELOG.md 2.7.0
error: not found release note for '2.7.0'

This is a bug of parse-changelog that doesn't handle the inline link in the title properly, and I have a fix in dev branch of parse-changelog.

@kirrg001
Copy link
Contributor

kirrg001 commented Sep 8, 2022

Cool 👍

I can test both changes (github_ref & inline link fix) when you are ready. Let me know

taiki-e and others added 3 commits September 9, 2022 00:04
@taiki-e
Copy link
Owner Author

taiki-e commented Sep 8, 2022

Published 1.6.0 which includes this changes (token and ref input option) and the inline link fix.

@kirrg001
Copy link
Contributor

I have tested the changes. They work. Thanks!
The only problem we still have is that our changelog contains H1 headlines (instead of h2/h3).
lerna/lerna#3324

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.

"GITHUB_TOKEN not set" error when running with act
2 participants