Opening a Pull Request
When you start out with a jam we ask your team leader to fork the code jam brief repository to their account for your to work on your code.
In this guide we're going to go over:
- Forking the repository
- Opening a pull request back to the code jam brief on python-discord
- Adding collaborators
- Adding a GitHub webhook to your teams Discord channel
Forking the repository
When you browse to the code jam brief repository you will be presented with the project root.
You want to fork the repository to your account using the button shown in the image below:
If you see a dialog like this one, just select your user.
Once you've done this you'll be redirected to a page like this:
And that's it! You've forked the repo!
Opening a Pull Request
Before we can open a Pull Request you need to have something to actually compare against the brief repo.
In the actual jam you should fill in the Project information section of the README.md, but for now I'm just going to add a line to the README.
Once you've made your commit, navigate back to the project root where you will see this button above your commit bar:
You should click on this pull request button. When you do you will see something like this, just click the Create pull request button:
Next up you'll see a form like this:
You should fill it in like so:
That's it! You've opened your pull request and should see something like this:
Obviously your fork is no good if your team members cannot make edits to it. To allow your team mates to edit you need to add them to the project as collaborators.
We're going to start off by heading to our fork of the repository (this is the one with your username in it, not python-discord) and head to the settings page.
Click on collaborators. GitHub will ask you to enter your password now for security. Enter it and proceed.
You should see a page like this:
Add your team members using this form and use the copy invite button to copy an invite link they can then use. You should send this to them in your team channel on Discord.
Once your team mates have joined you'll see this:
That's all! Your teammates have access to the repository now!
Add a GitHub webhook to Discord
It may be useful to keep up on your GitHub repository updates right from your Discord channel. For that reason, we've assigned all team leaders webhook creation permissions inside your team channel.
To make use of this we're going to start out by making a webhook inside the channel.
To do this go to your team channel and click on the gear that appears when you mouse-over it.
Navigate to the Webhooks section of the settings page and click
You'll see something like this:
You can edit the name to 'GitHub' or anything, but GitHub will do this anyway.
Copy the link to the clipboard, you will get something like this:
By default this is not configured to respond to GitHub payloads so you will need to add a
/github to the end of the URL.
Your new URL should look like:
Adding to GitHub
Next up we will head over to our GitHub project settings (on our fork) and go to the webhooks section:
Click on the Add Webhook button and paste in your URL to the
Payload URL section.
Content Type to
application/json otherwise Discord cannot interpret your request.
You can select either just the push or everything depending on how much information you want.
Active is ticked and click
And that's it! You've added a Discord webhook to your GitHub repository!
As you can see here, my teammate has commited a change to our fork:
In our Discord channel, you can see the following: