| 1 | # Contributing |
| 2 | |
| 3 | This guide will serve as a reference for contributing to Jpy. |
| 4 | |
| 5 | ## Getting the source |
| 6 | |
| 7 | Jpy uses the [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow). In this workflow, the [jpy-consortium/jpy](https://github.com/jpy-consortium/jpy) repository contains a minimum number of branches, and development work happens in user-forked repositories. |
| 8 | |
| 9 | To learn more see: |
| 10 | * [Forking Workflow](https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow) |
| 11 | * [Forking Projects](https://guides.github.com/activities/forking/) |
| 12 | * [Fork A Repo](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) |
| 13 | * [Working With Forks](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/working-with-forks) |
| 14 | |
| 15 | To get started quickly: |
| 16 | 1) Navigate to [https://github.com/jpy-consortium/jpy](https://github.com/jpy-consortium/jpy). |
| 17 | 2) Click `Fork` in the top right corner. |
| 18 | 3) `git clone [email protected]:<username>/jpy.git` |
| 19 | 4) Commit changes to your own branches in your forked repository. |
| 20 | |
| 21 | Forked repositories do not have access to the same tokens/secrets as the jpy-consortium/jpy depository, so GitHub actions that depend upon secrets will fail. |
| 22 | If you experience this problem, disable the offending GitHub action. To disable GitHub actions in your forked repository, go to "Actions" -> "Disable Actions" in your forked repository settings (`https://github.com/<username>/jpy/settings/actions`). |
| 23 | |
| 24 | Over time, forks will get out of sync with the upstream repository. To stay up to date, either: |
| 25 | * Navigate to `https://github.com/<username>/jpy` and click on `Fetch upstream`, or |
| 26 | * Follow these directions on [Syncing A Fork](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/syncing-a-fork). |
| 27 | |
| 28 | ## Creating a Pull Request |
| 29 | Pull requests can be created through the GitHub website or through the GitHub CLI. |
| 30 | |
| 31 | ### GitHub Web |
| 32 | |
| 33 | Follow the directions in [Creating A Pull Request From A Fork](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork). |
| 34 | |
| 35 | ### GitHub CLI |
| 36 | |
| 37 | 1) [Install GitHub command line tool](https://github.com/cli/cli). |
| 38 | 2) On the command line, cd into your checked-out fork/branch. |
| 39 | 3) `gh pr create -f -w` |
| 40 | * Use `jpy-consortium/jpy` as the base repository. |
| 41 | * Use `<username>/jpy` as the repository to push to. |
| 42 | 4) Your changes should automatically get pushed, and then a new pull request with your changes should open up in your browser. |
| 43 | 5) Complete the information in the pull request and click `Create pull request`. |
| 44 | |
| 45 | For more information, see: |
| 46 | * [gh pr create](https://cli.github.com/manual/gh_pr_create) |
| 47 | * [CLI In Use](https://cli.github.com/manual/examples.html) |
| 48 |