Approving
- Git course
- Intermediate
- Lesson 59/82
- 4 min
Learn the flow to approve a PR.
Approving a Pull Request
After reviewing a Pull Request, you can approve it if you consider the changes acceptable. On GitHub, this is done using the Approve option, and the review result is recorded on the PR.
Review status: Approved
Pull Request: #24Approval indicates that the reviewer considers the current changes acceptable. However, it does not merge the PR by itself.
The relationship between approval and merging
An approved Pull Request is an important step toward being ready for merging. However, the project may have branch protection rules or additional review requirements.
Review: Approved
Status: Ready for mergeOnce the required reviews are complete, an authorized person can merge the PR. Approving and merging are separate actions.
Practice Create an approval result
Create a pullRequest object. Set number to 32, review to "approved", and mergeReady to true. Then print the review status.
Starter code
const pullRequest = {
// PR bilgilerini ekle
};
// İnceleme sonucunu yazdırSample solution
const pullRequest = {
number: 32,
review: "approved",
mergeReady: true
};
console.log(pullRequest.review);Expected output
approved
Questions and answers
Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.
1 Which action is selected to give a positive review to a PR on GitHub?
- Delete branch
- Request changes
- Close pull request
- Approve Correct answer
Explanation: The Approve option indicates that the reviewer accepts the current changes.
2 Record the approval status
const review = {
reviewer: "Alex",
status: "____"
};
const review = {
reviewer: "Alex",
status: "approved"
};
Explanation: When the PR changes are accepted, the review status becomes approved.
3 Approval workflow
| Term | Meaning |
|---|---|
Review |
Examine the changes |
Approve |
Submit a positive review |
Approved |
An approved status |
Merge ready |
Ready to be merged |