actions-updater
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGitHub Actions Version Updater
GitHub Actions 版本更新工具
Update GitHub Actions in workflow files to their latest released versions. This replaces Dependabot's functionality.
package-ecosystem: "github-actions"将工作流文件中的GitHub Actions更新至其最新发布版本。此工具可替代Dependabot的功能。
package-ecosystem: "github-actions"Process
操作流程
Step 1: Check for Updates
步骤1:检查更新
Run the bundled script to parse all lines and query each action's latest release:
uses:uv run actions-updater/scripts/check_updates.pyWith no arguments, the script scans and . To check specific files:
.github/workflows/*.yml*.yamluv run actions-updater/scripts/check_updates.py path/to/workflow.yamlThe script parses workflow YAML, recursively extracts all entries, queries for each, and outputs a comparison table showing the current and latest major versions. It skips local actions () and Docker actions ().
uses: owner/repo@versiongh release view --repo owner/repo./...docker://...运行内置脚本解析所有行,并查询每个Action的最新发布版本:
uses:uv run actions-updater/scripts/check_updates.py若不带参数,脚本会扫描和文件。若要检查特定文件:
.github/workflows/*.yml*.yamluv run actions-updater/scripts/check_updates.py path/to/workflow.yaml该脚本会解析工作流YAML文件,递归提取所有条目,为每个条目调用进行查询,并输出对比表格,显示当前版本和最新主版本。它会跳过本地Actions()和Docker Actions()。
uses: owner/repo@versiongh release view --repo owner/repo./...docker://...Step 2: Update Workflow Files
步骤2:更新工作流文件
For each action with an available update, edit the workflow file using the Edit tool.
Version format rules:
- If the current pin is a major version tag (e.g., ), extract the major version from the latest release tag and update to that (e.g.,
@v3becomesv4.2.1)@v4 - If the current pin is an exact version (e.g., ), update to the full latest release tag
@v3.1.0 - If the current pin is a SHA, flag it for the user but do not auto-update
对于每个有可用更新的Action,使用编辑工具修改工作流文件。
版本格式规则:
- 如果当前固定的是主版本标签(例如),从最新发布标签中提取主版本并更新(例如
@v3会更新为v4.2.1)@v4 - 如果当前固定的是精确版本(例如),更新为完整的最新发布标签
@v3.1.0 - 如果当前固定的是SHA值,标记出来供用户查看,但不会自动更新
Step 3: Summarize
步骤3:总结
Present a table of all updates applied, showing the action, old version, and new version.
展示所有已应用更新的表格,包含Action名称、旧版本和新版本。
Scripts
脚本
scripts/check_updates.py
scripts/check_updates.pyscripts/check_updates.py
scripts/check_updates.pyCheck all workflow actions for available updates. Requires authenticated CLI.
ghuv run scripts/check_updates.py # scans .github/workflows/
uv run scripts/check_updates.py path/to/ci.yaml # specific file(s)检查所有工作流Actions的可用更新。需要已认证的 CLI。
ghuv run scripts/check_updates.py # 扫描.github/workflows/目录
uv run scripts/check_updates.py path/to/ci.yaml # 特定文件