Skip to content

Commit 1e0a37c

Browse files
committed
README: Add tasks on approved PRs
Add instructions on having PRs approved by a contributor. Signed-off-by: Razvan Deaconescu <razvan@rosedu.org>
1 parent f473d36 commit 1e0a37c

1 file changed

Lines changed: 62 additions & 4 deletions

File tree

README.md

Lines changed: 62 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ For each repository, use the GitHub CLI tool to:
9797
## Create Work GitHub Repository
9898

9999
Let's first create a work GitHub repository based on the current repository.
100-
We will use it for toying arround, messing it up and fixing it.
100+
We will use it for toying around, messing it up and fixing it.
101101

102102
First, make sure you are in the local directory clone of this repository (`workshop-github`).
103103
Then, create a repository on GitHub from the command line (using GitHub CLI - `gh`):
@@ -173,13 +173,13 @@ For that, in the GitHub web interface for the pull request follow the steps:
173173

174174
1. Click the `Review changes` button.
175175

176-
1. Approve the pull request.
176+
1. Aim to approve your pull request.
177+
You cannot approve your pull request, if you're the author.
177178

178179
1. Now, get back to the `Conversation` tab.
179-
See that the pull request is now approved.
180180
Go below to the `Merge pull request` button.
181181

182-
Below clicking the button, see the options from the little dropdown option on the right.
182+
Below clicking the button, see the options from the little drop-down option on the right.
183183
See what are the options, choose one and do it.
184184

185185
### Do It Yourself
@@ -200,6 +200,64 @@ For that, in the GitHub web interface for the pull request follow the steps:
200200
Create at least one pull request with two commits.
201201
Use the `Squash and merge` merge strategy.
202202

203+
## Approve Pull Request
204+
205+
In order to approve a pull request, you need to have another user able to approve your pull requests.
206+
207+
Before everything, reset the repository:
208+
209+
```console
210+
./gh-reset-repo.sh
211+
```
212+
213+
And create the pull request, as above.
214+
215+
To add someone to be able to approve your pull requests, they need to have `Triage` permissions.
216+
For this, do the following:
217+
218+
1. Go to the `Settings` tab in the GitHub web view of your repository.
219+
220+
1. Go to the `Collaborators` entry in the left menu.
221+
You'll have to provide your GitHub password, or use some other authentication method.
222+
223+
1. Ask someone around you for their GitHub username.
224+
Add them to the repository as collaborator.
225+
226+
1. Ask them to confirm the invite via e-mail or by accessing the invitation URL: `https://github.com/<your-github-username>/workshop-github/invitations`
227+
228+
1. Ask them to approve your pull request.
229+
230+
1. Now merge the pull request.
231+
232+
## Require Approval for Pull Requests
233+
234+
We want to enforce an approval for our pull requests.
235+
236+
Before everything, reset the repository:
237+
238+
```console
239+
./gh-reset-repo.sh
240+
```
241+
242+
And create the pull request, as above.
243+
244+
Now add a ruleset to add a required approval condition.
245+
For this, do the following:
246+
247+
1. Go to the `Settings` tab in the GitHub web view of your repository.
248+
249+
1. Go to the `Branches` entry in the left menu.
250+
251+
1. Click `Add branch ruleset`.
252+
253+
1. Check `Require a pull request before merging`.
254+
255+
1. Add `1` to `Required approvals`.
256+
257+
1. Now ask for an approval for your pull request, as above.
258+
259+
1. Merge the pull request with the approval now done.
260+
203261
## Configure Merge Strategy
204262

205263
We want to configure `Rebase and merge` as the only merge strategy.

0 commit comments

Comments
 (0)