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

[维护] 重写图片压缩相关的工作流 #140

Open
northword opened this issue Mar 4, 2024 · 1 comment
Open

[维护] 重写图片压缩相关的工作流 #140

northword opened this issue Mar 4, 2024 · 1 comment
Labels
维护 与仓库维护有关的议题

Comments

@northword
Copy link
Member

议题内容

当前是在主分支定时运行压缩图片,这会导致仓库历史记录中仍然存在未压缩的图片。

现有压缩 PR 图片的工作流由于 是压缩了所有图片,不支持仅压缩有变动的图片,会超出 GitHub API 的限制1,故已停用。

需要自行写一个类似的工作流,当 PR 时触发,遍历图片目录,获取有变动的图片,压缩,提交。合并 PR 时以压缩提交的形式,这样合入主分支的就已经是压缩后的图片,不会产生无用的历史冗余。

可以有一个文件存储已压缩图片的路径以便于下次运行时跳过该文件。

可以参考以下库实现压缩过程:

这可以是直接在 Action 里调用 npx,也可以是写一个 js 文件,在 Action 里 node xxx.js。后者可以将文件存在 .github 里或 scripts 里。

其他信息

No response

Footnotes

  1. https://github.com/calibreapp/image-actions/issues/92

@northword northword added the 维护 与仓库维护有关的议题 label Mar 4, 2024
@northword
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
维护 与仓库维护有关的议题
Projects
Status: Todo
Development

No branches or pull requests

1 participant