mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-18 01:35:58 +08:00
2.8 KiB
2.8 KiB
快速开始
1. 新建 Action
点击仓库的 Actions,若已增加过 Actions,会显示如下界面。
点击 New workflow
新增。
2. 编写 Action
Actions 存放地址是固定的,统一为 /.github/workflows/xx.yml
。
下面拿首页的例子详细说明下。对应场景为:当一个 issue 新增 help wanted
标签时,系统会自动进行评论。
name: Issue Reply
on:
issues:
types: [labeled]
jobs:
reply-helper:
runs-on: ubuntu-latest
steps:
- name: help wanted
if: github.event.label.name == 'help wanted'
uses: actions-cool/issues-helper@v3
with:
actions: 'create-comment'
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. We totally like your proposal/feedback, welcome PR。
你好 @${{ github.event.issue.user.login }},我们完全同意你的提议/反馈,欢迎PR。
YML
语法参考name
:workflow 名称- Actions 流程名称,可根据实际情况自定义
on
:action 触发条件- 参考 工作流触发机制
uses
:使用 actions 名称uses: actions-cool/issues-helper@v2.0.0
。版本选择请 参考
issues-hepler
参数
3. 启用 Action
当你完成编写完成提交到主分支后,即可自动启用该 workflow,触发条件遵循 on
的定义。
😏 相信到这里你已经对 如何使用
有了大概的了解,是不是想快点尝试一下。