@@ -4,22 +4,23 @@ GitHub Actions CLI
44The purpose of this tool is to work with your GitHub Actions workflows in your repositories.
55It is complementary to the GitHub CLI.
66
7+ It is important ` GITHUB_TOKEN ` environment variable is set in order for it to work properly.
8+
79So far, three main flows are supported:
810
911# List all workflows path and name in a specified repository.
1012
1113Example:
1214
1315``` shell
14- github-actions-cli cunla/fakeredis list-workflows
16+ github-actions-cli -repo cunla/fakeredis list-workflows
1517```
18+
1619will return:
1720
1821``` text
19- .github/workflows/publish.yml:Upload Python Package
20- .github/workflows/test.yml:Unit tests
21- dynamic/github-code-scanning/codeql:CodeQL
22- dynamic/pages/pages-build-deployment:pages-build-deployment
22+ .github/workflows/publish.yml
23+ .github/workflows/test.yml
2324```
2425
2526# List all actions ` uses ` in a workflow
@@ -28,33 +29,41 @@ Given a repo and a workflow path, return all actions in the workflow.
2829
2930Example:
3031``` shell
31- github-actions-cli cunla/fakeredis list-actions .github/workflows/publish .yml
32+ github-actions-cli -repo cunla/fakeredis list-actions .github/workflows/test .yml
3233```
3334
3435Result
3536``` text
36- pypa/gh-action-pypi-publish@release/v1
3737actions/checkout@v3
38+ ./.github/actions/test-coverage
39+ release-drafter/release-drafter@v5
3840actions/setup-python@v4
3941```
4042
41- # Update all actions in a repository workflow(s)
42- Show the latest versions of actions used in a repository workflow.
43+ # Update all actions in a repository workflows
44+ List the latest versions of actions used in a repository workflow and update the workflow files .
4345
44- Example:
46+ Example for local clone of repository :
4547``` shell
46- github-actions-cli cunla/fakeredis update
48+ github-actions-cli update-actions --dry-run
4749```
50+
51+ or for remote repository without cloning:
52+
53+ ``` shell
54+ github-actions-cli -repo cunla/fakeredis update-actions --dry-run
55+ ```
56+
4857Result:
4958``` text
50- .github/workflows/publish .yml
51- actions/setup-python @ v4 ==> v4.7 .0
52- pypa/gh-action-pypi-publish @ release/v1 ==> v1.8.8
53- actions/checkout @ v3 ==> v3.5.3
54- .github/workflows/test .yml
55- actions/setup-python @ v4 ==> v4.7.0
56- release-drafter/release-drafter @ v5 ==> v5.24.0
57- actions/checkout @ v3 ==> v3.5.3
59+ ./. github/workflows/test .yml:
60+ release-drafter/release-drafter v5 ==> v5.24 .0
61+ actions/checkout v3 ==> v3.5.3
62+ actions/setup-python v4 ==> v4.7.0
63+ ./. github/workflows/publish .yml:
64+ pypa/gh-action-pypi-publish release/v1 ==> v1.8.8
65+ actions/checkout v3 ==> v3.5.3
66+ actions/setup-python v4 ==> v4.7.0
5867```
5968
6069# Installation
@@ -66,17 +75,16 @@ pip install github-actions-cli
6675# Help messages
6776
6877``` text
69- usage: github-actions-cli [-h] [--github-token GITHUB_TOKEN] repo {list-workflows,list-actions,update} ...
70-
71- positional arguments:
72- repo Repository to analyze
73- {list-workflows,list-actions,update}
74- list-workflows List github workflows
75- list-actions List actions in a workflow
76- update Update actions in github workflows
77-
78- options:
79- -h, --help show this help message and exit
80- --github-token GITHUB_TOKEN
81- GitHub token to use, by default will use GITHUB_TOKEN environment variable
82- ```
78+ Usage: github-actions-cli [OPTIONS] COMMAND [ARGS]...
79+
80+ Options:
81+ -repo TEXT Repository to analyze
82+ --github-token TEXT GitHub token to use, by default will use GITHUB_TOKEN
83+ environment variable
84+ --help Show this message and exit.
85+
86+ Commands:
87+ list-actions List actions in a workflow
88+ list-workflows List workflows in repository
89+ update-actions List actions in a workflow
90+ ```
0 commit comments