No project description provided
Project description
gha-tools
Table of Contents
Installation
pip install gha-tools
You can also use pipx to directly run gha-tools.
Usage
Automatically updating workflow action versions
Use gh-tools autoupdate on a workflow file or directory to automatically
update the action versions to the latest available version.
- By default, the command will not write changes to the file system; use
--writeto have it do that. - You can use
--diffto see what changes would be made. This can be used in conjunction with--write. - You can use
--version-strategy=specificto update to a specific latest version tag instead of the major tag, e.g.v1.2.3instead ofv1. The default is to use the major tag, when available.- You can use
--first-party-version-strategyand--third-party-version-strategyto set different version strategies for first-party and third-party actions respectively.
- You can use
$ gha-tools autoupdate --diff .github/workflows
Updating .github/workflows/publish.yml...
No changes to .github/workflows/publish.yml.
Updating .github/workflows/ci.yml...
--- .github/workflows/ci.yml
+++ .github/workflows/ci.yml
@@ -34,7 +34,7 @@
requirements*txt
- run: 'pip install -e . -r requirements-test.txt'
- run: py.test -vvv --cov .
- - uses: codecov/codecov-action@v2
+ - uses: codecov/codecov-action@v3
Lint:
runs-on: ubuntu-20.04
Version pinning
GitHub Actions best practice is to pin the versions of actions to a specific version SHA, as tags may be mutable.
You can use --pin to have gha-tools autoupdate pin the action to the latest commit SHA for the specified version tag.
If you trust the first-party actions to use immutable tags, use --pin=third_party; otherwise use --pin=all.
$ gha-tools autoupdate --pin=third_party --diff .github/workflows
Updating .github/workflows/test.yml...
--- .github/workflows/test.yml
+++ .github/workflows/test.yml
@@ -12,13 +12,13 @@
lint:
runs-on: ubuntu-latest
steps:
- - uses: actions/checkout@v3
- - uses: akx/pre-commit-uv-action@v0.1.0
+ - uses: actions/checkout@v5
+ - uses: akx/pre-commit-uv-action@19e2cbdb93404ff82f52044f07306443bc0bff7a # v0.1.0
Separate version strategies
You can use different version strategies for first-party and third-party actions. For example, to keep first-party actions on major versions but use specific versions for third-party actions:
$ gha-tools autoupdate --first-party-version-strategy=major --third-party-version-strategy=specific --diff .github/workflows
Updating .github/workflows/test.yml...
--- .github/workflows/test.yml
+++ .github/workflows/test.yml
@@ -5,6 +5,6 @@
steps:
- - uses: actions/checkout@v3
- - uses: actions/setup-python@v4
- - uses: codecov/codecov-action@v3
+ - uses: actions/checkout@v5
+ - uses: actions/setup-python@v6
+ - uses: codecov/codecov-action@v5.5.1
GitHub Rate Limiting
Since this tool uses the GitHub API, you may run into rate limiting issues.
You can specify your GitHub authentication via the environment variable GITHUB_TOKEN or GITHUB_AUTH.
If the value of the environment variable contains a colon (:), it will be interpreted as a username and password;
this is useful with Personal Access Tokens, which are used with your GitHub username.
License
gha-tools is distributed under the terms of the MIT license.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gha_tools-0.3.0.tar.gz.
File metadata
- Download URL: gha_tools-0.3.0.tar.gz
- Upload date:
- Size: 9.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a5931d8ba756c11468680ff5ba390827e22424e2855ba200bf99cc5f7520818
|
|
| MD5 |
c19360a16f6a10fa66f727facd503f21
|
|
| BLAKE2b-256 |
4e3865d3afeae53c4320ebbddb4992966676dbcce784b5939393d351887a1e56
|
Provenance
The following attestation bundles were made for gha_tools-0.3.0.tar.gz:
Publisher:
ci.yml on akx/gha-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gha_tools-0.3.0.tar.gz -
Subject digest:
1a5931d8ba756c11468680ff5ba390827e22424e2855ba200bf99cc5f7520818 - Sigstore transparency entry: 646256761
- Sigstore integration time:
-
Permalink:
akx/gha-tools@39516aa5cab527b6927cb4ed27b2a7b6c7977fff -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/akx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@39516aa5cab527b6927cb4ed27b2a7b6c7977fff -
Trigger Event:
push
-
Statement type:
File details
Details for the file gha_tools-0.3.0-py3-none-any.whl.
File metadata
- Download URL: gha_tools-0.3.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de74c93b2f8c1cffcfb9f54c739ce3df0a91816fdce8fbb7f8e1f0c46603672a
|
|
| MD5 |
6e5cfa1a6b215f412780501e6affc564
|
|
| BLAKE2b-256 |
be712d7164b62e99a541c54c17135f218710c15981559915e8594db9f35a152c
|
Provenance
The following attestation bundles were made for gha_tools-0.3.0-py3-none-any.whl:
Publisher:
ci.yml on akx/gha-tools
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gha_tools-0.3.0-py3-none-any.whl -
Subject digest:
de74c93b2f8c1cffcfb9f54c739ce3df0a91816fdce8fbb7f8e1f0c46603672a - Sigstore transparency entry: 646256809
- Sigstore integration time:
-
Permalink:
akx/gha-tools@39516aa5cab527b6927cb4ed27b2a7b6c7977fff -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/akx
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@39516aa5cab527b6927cb4ed27b2a7b6c7977fff -
Trigger Event:
push
-
Statement type: