https://github.com/olivermking/typescript-build-check-workflow
Github workflow to guarantee TypeScript code has been built (compiled) in pull request
https://github.com/olivermking/typescript-build-check-workflow
bash github-workflow javascript typescript
Last synced: about 1 month ago
JSON representation
Github workflow to guarantee TypeScript code has been built (compiled) in pull request
- Host: GitHub
- URL: https://github.com/olivermking/typescript-build-check-workflow
- Owner: OliverMKing
- License: mit
- Created: 2021-11-26T22:38:56.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-29T02:55:35.000Z (over 4 years ago)
- Last Synced: 2024-10-05T12:42:19.053Z (over 1 year ago)
- Topics: bash, github-workflow, javascript, typescript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# typescript-build-check-workflow
Github workflow to guarantee TypeScript code has been built in a pull request.
This has a few clear advantages:
- Code doesn't have to be reviewed twice (TypeScript and compiled JavaScript)
- Compiled JavaScript need to be completely reviewed since we know whether the TypeScript has been compiled (compiled JavaScript is often difficult to read)
- Catches the common error of not compiling to TypeScript before a pull request
- Prevents a malicious actor from slipping extra code into the "compiled" JavaScript undetected
## Usage
Copy the [ts-build-check.yml file](./ts-build-check.yml) to your `.github` directory. Modify the steps under to fit your project.
`Clone and Build Pull Request` should install all dependencies for your project (it currently uses npm). It can be easily modified to fit your project's dependency installation process.
`Compare Built Directories` checks the out of your repo's TypeScript build. Modify the `diff` command path to match your output directory. The example's TypeScript is compiled to a root-level `lib` directory in the repo.
The comment left on failed PRs can be modified under the `body` section of the `Comment Unbuilt TypeScript` step.
## Planned Updates
- Shorten `diff` flags (figure out which ones are key)