Skip to content

Latest commit

 

History

History
107 lines (76 loc) · 2.95 KB

CONTRIBUTING.md

File metadata and controls

107 lines (76 loc) · 2.95 KB

Contributing

All contributions are welcome and greatly appreciated! However, please try to keep them limited in scope so that they can be more easily reviewed.

Steps to Contribute

Warning

Check the engine property in package.json to see what version of Node.js is required for local development. This can be different from the version of Node.js used on the GitHub Actions runners. Tools like nodenv can be used to manage your Node.js version automatically.

  1. Fork this repository

  2. Clone your fork

  3. Install the dependencies with npm install

  4. Make and test your changes

  5. Commit your changes

    Make sure to do the following when you commit your changes:

    • Increase the version number in package.json
    • Run npm install to ensure dependencies are up to date
    • Run npm run all to run formatting, linting, etc.
  6. Open a pull request back to this repository

  7. Notify the maintainers of this repository for peer review and approval

  8. Merge 🎉

The maintainers of this repository will create a new release with your changes so that everyone can enjoy your contributions!

Testing

This project requires 100% test coverage.

Important

It is critical that we have 100% test coverage to ensure that we are not introducing any regressions. All changes will be throughly tested by maintainers of this repository before a new release is created.

Testing Local Updates

As you make changes, it's a great idea to run the local-action tool regularly against various repositories with different configurations.

  1. Symlink your package folder (this should only need to be done once)

    npm link
  2. Test your updated version

    local-action run <path> <entrypoint> <dotenv file>
    
    # Or...
    npm exec local-action run <path> <entrypoint> <dotenv file>

Once you're finished testing, make sure to unlink!

npm unlink @github/local-action

Example Actions to Test

After making updates and running the test suite, please also make sure to test your updates using the following GitHub Actions repositories:

  1. Clone each repository locally

  2. From your github/local-action fork, test each action

    npm exec local-action \
    "/<action repository clone path>/typescript-action" \
    "src/main.ts" \
    "<path to your .env file>"
    
    npm exec local-action \
    "/<action repository clone path>/javascript-action" \
    "src/main.ts" \
    "<path to your .env file>"

    For an example .env file to use for testing, see .env.example.

Running the Test Suite

Simply run the following command to invoke the entire test suite:

npm run test

Note

This requires that you have already run npm install