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.
- released_artifact_name: The filename of the released artifact (or a unique part of it).
- artifact_path: The path of the current artifact that has been built.
- max_increase_percentage: The maximum increase percentage allowed.
- github_token: The token to authenticate Octokit (increases your API rate limit).
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
.
# 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
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.