Skip to main content

GitHub Actions CLI - allows updating workflows, etc.

Project description

GitHub Actions CLI

The purpose of this tool is to work with your GitHub Actions workflows in your repositories. It is complementary to the GitHub CLI.

Basic usage

Run github-actions-cli within a directory which has a clone of a GitHub repository. The tool will list the GitHub actions workflows, the actions they use, the current versions they use, and the latest versions of the 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

Supported use cases

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 List all actions that are out of date in a repository (Default)

List the latest versions of actions used in a repository workflows and potentially update the workflow files.

For example, running github-actions-cli without any parameters will look for workflows in the current directory (.), check whether there are updates required for the actions in the workflows it finds.

Another example, running on a remote repository, github-actions-cli -repo cunla/fakeredis update-actions -u, will look for the latest versions of the actions used in the repository cunla/fakeredis, and because of the -u flag, it will create a commit updating the workflows to the latest.

Note: Having GITHUB_TOKEN with permissions to make commits on the repository is required in order to write to repository.

Parameters:

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.

If you want the check to compare exact versions and not only major versions, use the --compare-exact-versions flag.

list-workflows List all workflow paths and names in a specified repository.

Example:

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

will return:

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

list-actions List all actions uses in a workflow

Given a repo and a workflow path, return all actions in the workflow.

Example:

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

Result

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

Installation

pip install github-actions-cli

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_actions_cli-1.1.1.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

github_actions_cli-1.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file github_actions_cli-1.1.1.tar.gz.

File metadata

  • Download URL: github_actions_cli-1.1.1.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for github_actions_cli-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5c1d75bdd6583ac25548cd71236ab6456343b1fb5e2507d54cc74385563eabc0
MD5 a96a11bef4321f707a3a9694c05f5463
BLAKE2b-256 85a46d505e1d0764441e37bd48225d530b16cd63dc7ce84ab545ff92deab9ed7

See more details on using hashes here.

File details

Details for the file github_actions_cli-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github_actions_cli-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ba9d3f7f1d68a478e78f9752789ae5883a218889ca98f235568fa920bb8d0efd
MD5 89bc0485d8458033f5289077ee5ec68c
BLAKE2b-256 41b07dfc992d3fc43f5fce62355e07dbc8c302c34f5cb705cb06f583cefad8cb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page