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.
当 release types 为 published 时,支持发布和预发布时触发事件。假如一个新仓库仅有 prerelease 记录,且设置
enable_prerelease
为 true 时。会抛出 Not Found 错误。
在 action 中报错如下图
URL 请求返回报错如下图
这是因为原代码默认会通过
https://api.github.com/repos/owner/repo/releases/latest
先读 releases/latest,而 prerelease 不属于 latest,所以在仅有 prerelease 的仓库,这个 API 拿不到数据抛出了上述错误。这个 PR 的改动为,如果
enablePrerelease
为 true,读取 releases。如果enablePrerelease
为 false,才读取 releases/latest。