branch-deploy/CONTRIBUTING.md

57 строки
2.4 KiB
Markdown
Исходник Обычный вид История

2022-05-05 00:52:30 +03:00
# Contributing 💻
All contributions are welcome and greatly appreciated!
## Steps to Contribute 💡
2023-03-02 15:39:13 +03:00
> Check the `.node-version` file in the root of this repo so see what version of Node.js is required for local development - note, this can be different from the version of Node.js which runs the Action on GitHub runners. It is suggested to download [nodenv](https://github.com/nodenv/nodenv) which uses this file and manages your Node.js versions for you
2022-09-13 01:44:18 +03:00
2022-05-05 00:52:30 +03:00
1. Fork this repository
2. Commit your changes
3. Test your changes (learn how to test below)
4. Open a pull request back to this repository
2023-02-17 21:48:42 +03:00
> Make sure to run `npm run all` as your final commit!
2022-05-05 00:52:30 +03:00
5. Notify the maintainers of this repository for peer review and approval
6. Merge!
The maintainers of this repository will create a new release with your changes so that everyone can use the new release and enjoy the awesome features of branch deployments
## Testing 🧪
2022-05-17 05:45:03 +03:00
This project requires **100%** test coverage
2023-03-02 15:39:13 +03:00
> The branch-deploy Action is used by enterprises, governments, and open source organizations - 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.
2023-03-02 15:40:05 +03:00
### Running the test suite (required)
2022-05-17 05:45:03 +03:00
Simply run the following command to execute the entire test suite:
```bash
npm run test
```
> Note: this requires that you have already run `npm install`
### Testing directly with IssueOps
2022-05-05 00:52:30 +03:00
2023-03-02 15:39:13 +03:00
> See the testing FAQs below for more information on this process
2022-05-05 00:52:30 +03:00
You can test your changes by doing the following steps:
1. Commit your changes to the `main` branch on your fork
2. Open a new pull request
2023-07-18 15:14:05 +03:00
3. Run IssueOps commands on the pull request you just opened (`.deploy`, `.noop`, `.deploy main`, etc)
2022-05-05 00:52:30 +03:00
4. Ensure that all IssueOps commands work as expected on your testing PR
### Testing FAQs 🤔
Answers to questions you might have around testing
Q: Why do I have to commit my changes to `main`?
2022-06-17 20:48:32 +03:00
A: The `on: issue_comment` workflow only uses workflow files from the `main` branch by design - [learn more](https://github.com/github/branch-deploy#security-)
2022-05-05 00:52:30 +03:00
2023-03-02 15:39:13 +03:00
Q: How can I test my changes once my PR is merged and *before* a new release is created?
2022-05-05 00:52:30 +03:00
2023-03-02 15:39:13 +03:00
A: You should create a repo like [this one](https://github.com/GrantBirki/actions-sandbox) that uses `github/branch-deploy@main` as the Action version and test your changes there