halo-dev / plugin-starter

Halo 2.0 插件开发快速开始模板
GNU General Public License v3.0
43 stars 63 forks source link

Upgrade the version of the action steps #27

Closed Mystery00 closed 8 months ago

Mystery00 commented 8 months ago

根据Github的相关文档说明,在后期会弃用set-output的方式设置Action的返回值,因此按照文档的方式对设置返回值的逻辑进行修改,同时更新目前使用到的Actions的版本,规避set-output的问题同时修复低版本Actions中可能存在的漏洞

Github文档: GitHub Actions: Deprecating save-state and set-output commands

None
Mystery00 commented 8 months ago

修改之前: https://github.com/Mystery00/halo-plugin-telegram-moment/actions/runs/8171712106 image

修改之后: https://github.com/Mystery00/halo-plugin-telegram-moment/actions/runs/8171822554 image

Mystery00 commented 8 months ago

长久来看,可以提供一个公开的workflows仓库,将插件的构建流程写到workflows仓库中,starter模板引用workflows仓库的流水线内容,需要自定义的部分以参数的形式提供,以下是相关文档: Reusing workflows

实践内容可参考: https://github.com/Mystery0Tools/workflows/tree/main/.github/workflows

ruibaby commented 8 months ago

长久来看,可以提供一个公开的workflows仓库,将插件的构建流程写到workflows仓库中,starter模板引用workflows仓库的流水线内容,需要自定义的部分以参数的形式提供,以下是相关文档: Reusing workflows

实践内容可参考: Mystery0Tools/workflows@main/.github/workflows

不错的建议,是有这个计划的,可以 follow:https://github.com/halo-sigs/actions/issues/10

但暂时还没时间弄。

guqing commented 8 months ago

/retitle Upgrade the version of the action steps

f2c-ci-robot[bot] commented 8 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: guqing, JohnNiang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/halo-dev/plugin-starter/blob/main/OWNERS)~~ [JohnNiang,guqing] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
sczhaoqi commented 8 months ago

@Mystery00 @guqing uses: actions/github-script@v7 对应 github.repos.uploadReleaseAsset 应该为 github.rest.repos.uploadReleaseAsset 同时 workflow权限需要调整为Read and write permissions

Settings -> Actions -> General -> Workflow permissions -> Read and write permissions
guqing commented 8 months ago

@Mystery00 @guqing uses: actions/github-script@v7 对应 github.repos.uploadReleaseAsset 应该为 github.rest.repos.uploadReleaseAsset 同时 workflow权限需要调整为Read and write permissions

Settings -> Actions -> General -> Workflow permissions -> Read and write permissions

Hi @sczhaoqi , 感谢提醒,我们已经提供了新的 workflows 配置可以引用,已经考虑到了这个问题,稍后我会提交一个 PR 来替换 workflow 的配置 , 可以查看 https://github.com/halo-dev/plugin-starter/pull/28