
GitHub Swift Actions (测试版)
此仓库包含使用 Swift 构建的 GitHub 组合操作。
这是一系列组合
- 为了创建方便的用例,创建了一个 Swift 包可执行文件,
- 为了创建 GitHub 组合操作,
- 然后,利用 GitHub Actions
Release
操作使用 Swift CLI 工具在 GitHub 上创建版本。 您可以使用它来升级主版本号、次版本号或补丁版本号。
操作:Comment (评论)
Comment
操作使用 Swift CLI 工具在 GitHub 问题上发表评论。 您可以使用它来自动创建或更新评论。
Comment
操作需要以下输入
number
:(必需)要评论的问题编号。
body
:(必需)评论的正文。
owner
:(必需)存储库的所有者。
repo
:(必需)存储库的名称。
token
:(必需)具有评论权限的 GitHub 令牌。
anchor
:(必需)评论的锚文本。
要在 GitHub Actions 工作流程中使用 Comment
操作,请在存储库的 .github/workflows
目录中创建一个 YAML 文件
|
name: Welcome (欢迎) |
|
|
|
on (当): |
|
issues (问题): |
|
types: [opened, reopened] (类型:[打开, 重新打开]) |
|
|
|
jobs (任务): |
|
say-hello-to-reporter (向报告者问好): |
|
runs-on: ubuntu-latest (运行在:ubuntu-latest) |
|
permissions (权限): |
|
pull-requests: write (pull-requests:写入) |
|
issues: write (issues:写入) |
|
steps (步骤): |
|
- uses: Wei18/GitHubSwiftActions/Actions/Comment@main (使用:Wei18/GitHubSwiftActions/Actions/Comment@main) |
|
with (使用): |
|
number: ${{ github.event.issue.number }} (number:${{ github.event.issue.number }}) |
|
body: | (body:|) |
|
Hello @${{ github.event.issue.user.login }}, (你好 @${{ github.event.issue.user.login }},) |
|
Thank you for opening this issue! We will review it and get back to you as soon as possible. (感谢您提出这个问题! 我们将尽快审查并回复您。) |
|
If you have any additional details or questions, please feel free to update this issue. (如果您有任何其他详细信息或问题,请随时更新此问题。) |
|
owner: ${{ github.repository_owner }} (owner:${{ github.repository_owner }}) |
|
repo: ${{ github.event.repository.name }} (repo:${{ github.event.repository.name }}) |
|
token: ${{ secrets.GITHUB_TOKEN }} (token:${{ secrets.GITHUB_TOKEN }}) |
|
anchor: "welcome-comment" (anchor:"welcome-comment") |
要在本地运行 Comment
操作,请使用
swift run --configuration release Comment
如果您有改进或错误修复,请随时提出问题或提交拉取请求。
本项目根据 MIT 许可证获得许可。 有关详细信息,请参阅 LICENSE 文件。