GitHub Swift Actions (测试版)

概述

此仓库包含使用 Swift 构建的 GitHub 组合操作。

构想

这是一系列组合

操作:Release (发布)

描述

Release 操作使用 Swift CLI 工具在 GitHub 上创建版本。 您可以使用它来升级主版本号、次版本号或补丁版本号。

操作:Comment (评论)

描述

Comment 操作使用 Swift CLI 工具在 GitHub 问题上发表评论。 您可以使用它来自动创建或更新评论。

输入

Comment 操作需要以下输入

示例用法

要在 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 文件。