quick-lint-js icon indicating copy to clipboard operation
quick-lint-js copied to clipboard

Feature: quick-release-notes.

Open kyle-wannacott opened this issue 4 years ago • 8 comments

You need to replace insert_github_access_token_here with your own personal GitHub access token that has push access privileges.

I don't know how best to handle the security aspect :shrug:

I ran it on my fork; this is the result: https://github.com/LeeWannacott/quick-lint-js/releases

kyle-wannacott avatar Mar 16 '22 05:03 kyle-wannacott

Is it possible to make the timestamps match the dates for historical releases? It currently says "3 hours ago" for each release.

Is this script idempotent? If I run the script multiple times, will it create duplicate releases or will it do nothing?

strager avatar Mar 16 '22 08:03 strager

Is this script idempotent? If I run the script multiple times, will it create duplicate releases or will it do nothing?

Yes it is idempotent; HTTP ~put~ PATCH requests may be made to the API to update a release: https://docs.github.com/en/rest/reference/releases#update-a-release

Is it possible to make the timestamps match the dates for historical releases? It currently says "3 hours ago" for each release.

I don't know :shrug: the API doesn't seem to provide such an option: https://docs.github.com/en/rest/reference/releases#create-a-release

Maybe if we give it the target_commitish from when the tag was put on it?; I don't know if that fixes the timestamp. :thought_balloon:

Edit: It doesn't fix the timestamp; the releases API just uses the tag name to get the SHA for target_commitish anyway so it is somewhat redundant giving it. I don't think you can change the timestamp not with the API anyway.

https://stackoverflow.com/questions/47141323/how-can-i-edit-a-github-release-date

kyle-wannacott avatar Mar 16 '22 09:03 kyle-wannacott

Must fix: Please include documentation on how to create a token (including required scopes).

strager avatar Apr 02 '22 00:04 strager

When I run the script, I get a bunch of "Response Headers" messages. Let's hide these messages by default, 'cus they're quite noisy.

strager avatar Apr 02 '22 00:04 strager

Must fix: The script doesn't check for some kinds of errors, such as missing/invalid auth token or insufficient permissions/scopes. When such an error occurs, the script might fail with a cryptic message, or might succeed with no error reported. I assume GitHub's API returns a helpful error message which the script should forward to the user.

strager avatar Apr 02 '22 01:04 strager

If there's an "Unreleased" section in CHANGELOG.md, I think the script should issue a warning saying that this section won't be synced to GitHub.

strager avatar Apr 02 '22 01:04 strager

  • Add date next to version number in release titles.
  • Delete draft feature. Doesn't make sense. I don't know why I suggested it.

strager avatar Apr 17 '22 04:04 strager

  • Only send an update request if the release notes have changed.

strager avatar Apr 17 '22 04:04 strager

👀

strager avatar Mar 31 '23 08:03 strager

  • Add date next to version number in release titles.

Done! https://github.com/LeeWannacott/quick-lint-js/commit/053ba4a8b7a2f2bf50015b3c7296c5d6fafb2473

kyle-wannacott avatar Apr 01 '23 02:04 kyle-wannacott

Fixed latest tag bug: https://github.com/LeeWannacott/quick-lint-js/commit/b01f9ff9a12317a50b42349ac94c61bfb21598bd

kyle-wannacott avatar Apr 03 '23 03:04 kyle-wannacott