跳转到主要内容

GitHub Actions CLI - 允许更新工作流程等。

项目描述

GitHub Actions CLI

此工具的目的是与您的GitHub Actions工作流程在您的仓库中协同工作。它是GitHub CLI的补充。

基本用法

在具有GitHub仓库克隆的目录中运行github-actions-cli。该工具将列出GitHub actions工作流程、它们使用的操作、它们使用的当前版本和操作的最新版本。

./.github/workflows/test.yml:
	actions/checkout                  v2 ==> v3
	release-drafter/release-drafter    v5
	actions/setup-python              v4
./.github/workflows/publish.yml:
	pypa/gh-action-pypi-publish       v1
	actions/checkout                  v2 ==> v3
	actions/setup-python              v3 ==> v4

支持的用例

Usage: github-actions-cli [OPTIONS] COMMAND [ARGS]...

Options:
  --repo TEXT               Repository to analyze, can be a local directory or
                            a {OWNER}/{REPO} format  [default: .]
  --github-token TEXT       GitHub token to use, by default will use
                            GITHUB_TOKEN environment variable
  --compare-exact-versions  Compare versions using all semantic and not only
                            major versions, e.g., v1 will be upgraded to
                            v1.2.3
  --help                    Show this message and exit.

Commands:
  list-actions    List actions in a workflow
  list-workflows  List workflows in repository
  update-actions  Show actions required updates in repository workflows

update-actions 列出仓库中过时的所有操作(默认)

列出仓库工作流程中使用的操作的最新版本,并可能更新工作流程文件。

例如,在不带任何参数的情况下运行github-actions-cli将在当前目录(.)中查找工作流程,并检查它找到的工作流程中操作是否需要更新。

另一个示例,在远程仓库上运行,github-actions-cli -repo cunla/fakeredis update-actions -u,将查找cunla/fakeredis仓库中使用的操作的最新版本,由于-u标志,它将创建一个提交,将工作流程更新到最新版本。

注意:要写入仓库,需要具有对仓库进行提交权限的GITHUB_TOKEN

参数

Usage: github-actions-cli update-actions [OPTIONS]

  Show actions required updates in repository workflows

Options:
  -u, --update      Update actions in workflows (For remote repos: make
                    changes and commit, for local repos: update files)
  -commit-msg TEXT  Commit msg, only relevant when remote repo  [default:
                    chore(ci):update actions]
  --help            Show this message and exit.

如果您想使检查比较确切的版本而不是仅比较主要版本,请使用 --compare-exact-versions 标志。

list-workflows 列出指定仓库中所有工作流程的路径和名称。

示例

github-actions-cli --repo cunla/fakeredis list-workflows

将返回

.github/workflows/publish.yml
.github/workflows/test.yml

list-actions 列出工作流程中使用的所有动作 uses

给定一个仓库和工作流程路径,返回工作流程中的所有动作。

示例

github-actions-cli --repo cunla/fakeredis list-actions .github/workflows/test.yml

结果

actions/checkout@v3
./.github/actions/test-coverage
release-drafter/release-drafter@v5
actions/setup-python@v4

安装

pip install github-actions-cli

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于 安装包 的信息。

源分发

github_actions_cli-1.1.5.tar.gz (7.7 kB 查看哈希)

上传时间

支持者