CodeBlanks Logo Icon CodeBlanks

Approving

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: #24

Approval 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 merge

Once 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

terminal
const pullRequest = {
    // PR bilgilerini ekle
};

// İnceleme sonucunu yazdır

Sample solution

terminal
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

Question
const review = {
    reviewer: "Alex",
    status: "____"
};
Answer
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

All lessons in Intermediate

20 Intermediate final

  1. Branch management
  2. Rebase
  3. Conflict
  4. PR flow