GitHub Action
Less is more - artifact size
This workflow will simply fail if the current artifact size has increased more than what is allowed when compared to the latest released artifact. It could be very useful to early identify unwanted size increases, especially on workflows that run for pull requests.
Name | Type | Description |
---|---|---|
released_artifact_name |
string |
The filename of the released artifact (or a unique part of it). |
artifact_path |
string |
The path of the current artifact (or a unique part of it). |
max_increase_percentage |
int>0 |
The maximum increase percentage allowed. |
Name | Type | Description | Default |
---|---|---|---|
github_token |
string |
The token to authenticate Octokit (increases your API rate limit). | "" |
fail_execution |
boolean |
Fail the execution if the artifact is bigger than allowed. | true |
Example: I want this workflow to fail if the artifact size that I'm building at dist/my-artifact.zip
has increased more than 10% when compared to my-released-artifact
, which is located on GitHub's releases page.
Note: If your released artifact contains variable parts, such as version, you can omit it. So my-released-artifact_v1.0.0.zip
can be simply my-released-artifact
, or even my-released-artifact_*.zip
.
# Build the artifact before using this workflow.
- uses: caponetto/[email protected]
with:
released_artifact_name: my-released-artifact
artifact_path: dist/my-artifact.zip
max_increase_percentage: 10
github_token: ${{ secrets.MY_TOKEN }}
All contributions are welcome, so don't hesitate to submit a pull request. ;-)
This code is released under MIT License.
Check LICENSE file for more information.