项目作者: tetchel

项目描述 :
Moved to https://github.com/redhat-actions/common/tree/main/bundle-verifier
高级语言: TypeScript
项目地址: git://github.com/tetchel/bundle-verifier.git
创建时间: 2020-11-09T19:17:14Z
项目社区:https://github.com/tetchel/bundle-verifier

开源协议:MIT License

下载


GitHub Action Bundle Verifier

Verify Self
Tag
Bundle Size
License

GitHub Action repositories are unusual in that their production bundle is committed to the repository.

This leads to a potential inconsistency where, if a developer updates the source code but does not run the compiler and/or bundler, the source code may not match the distribution that is committed. This is best resolved through pre-commit hooks.

The goal of this action is to bundle the source code and compare the generated bundle to that which was committed. If they match, the distibution is up-to-date and the action succeeds. Otherwise, the action fails.

There is no reason that this action can’t be used by projects other than GitHub Actions, but this action was developed for that use-case.

Inputs

See this repository’s workflow for an example.

Input Description
bundle_file Path, relative to the repository root, to your bundled js file. Only one regular file is supported.

For this repository, it is dist/index.js.
bundle_command Command to run to generate your bundle. A package.json script is recommended, which can in turn execute your bundler such as webpack or ncc.

For this repository, it is npm run bundle.

Hooks

To ensure bundle consistency, this repository uses git pre-commit hooks.

To install the hooks, run cp hooks/* .git/hooks/ and accept any overwrites.