Feature: quick-release-notes.
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
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?
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
Must fix: Please include documentation on how to create a token (including required scopes).
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.
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.
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.
- Add date next to version number in release titles.
- Delete draft feature. Doesn't make sense. I don't know why I suggested it.
- Only send an update request if the release notes have changed.
👀
- Add date next to version number in release titles.
Done! https://github.com/LeeWannacott/quick-lint-js/commit/053ba4a8b7a2f2bf50015b3c7296c5d6fafb2473
Fixed latest tag bug: https://github.com/LeeWannacott/quick-lint-js/commit/b01f9ff9a12317a50b42349ac94c61bfb21598bd