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

fix: 在仅有预发布记录的仓库中运行抛出not found的问题 #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

pddpd
Copy link

@pddpd pddpd commented Apr 12, 2022

当 release types 为 published 时,支持发布和预发布时触发事件。假如一个新仓库仅有 prerelease 记录,且设置 enable_prerelease 为 true 时。

  release:
    types:
      - published

enable_prerelease: true

会抛出 Not Found 错误。
在 action 中报错如下图
image
URL 请求返回报错如下图
image

这是因为原代码默认会通过 https://api.github.com/repos/owner/repo/releases/latest 先读 releases/latest,而 prerelease 不属于 latest,所以在仅有 prerelease 的仓库,这个 API 拿不到数据抛出了上述错误。
image

这个 PR 的改动为,如果 enablePrerelease 为 true,读取 releases。如果 enablePrerelease 为 false,才读取 releases/latest。

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.

None yet

1 participant