Skip to content

Latest commit

 

History

History
68 lines (50 loc) · 3.51 KB

CONTRIBUTING.md

File metadata and controls

68 lines (50 loc) · 3.51 KB

Contributing

Thank you for contributing!

We have prepared a short guide so that the process of making your contribution is as simple and clear as possible. Please check it out before you contribute.

Table of Contents

Prerequisites for Local Development

Before you start, ensure that you have the necessary dependencies for developing and building the action. Without the required dependencies, building or testing the action locally will fail.

Development and Testing

To develop the action locally, clone the repo and install the dependencies.

git clone https://github.com/endorlabs/github-action.git
cd github-action
yarn install

You're ready to start developing!

Code Structure

The source code and supporting resources for the action are laid out with the following structure:

  • __tests__/: Unit tests for the action logic and related test fixtures.
  • .github/: CI workflows to run tests and other code quality checks for PRs.
  • .licenses/: Cached OSS dependency licenses are stored here, and used by licensed to detect license changes.
  • dist/: The packaged source code + dependency code for the action. Typically build output is not tracked in source code for JavaScript projects, but the action dependencies must be packaged with the source code as the action does not run an install step when executing.
  • src/: The source code for the action.

Common tasks

  • yarn run all: This runs all of the tasks below. It is recommended to run this command before committing changes.
  • yarn run build: This transpile the TypeScript source code to JavaScript
  • yarn run format: This formats source files with Prettier, to ensure consistent formatting
    • yarn run format:fix: This applies recommended fixes for formatting issues from Prettier.
  • yarn run license: This validates the current expected dependency licenses with licensed
    • yarn run license:fix: This updates the currently cached list of licenses, to allow for manual review.
  • yarn run lint: This lints the source code with ESLint, to catch syntax errors and ensure code ensure a consistent code style
    • yarn run format:fix: This applies recommended fixes for linting issues from ESlint.
  • yarn run package: This packages the action source code and dependency code together under dist/
  • yarn test: This runs the unit test suites defined with Jest