Category: github

In continuation to part 1 of the series, we will explore Github API as well, to address one issue. When we add Github Actions to our repo, we can protect merging a PR to branch by enabling the following options in Branch protection rule: But if we have a requirement to deploy when the review is: When we check the Github Actions documentation for pull_request, it has hooks for ready_for_review, review_requested & review_request_removed.

But when we want to deploy on approved merge, we do not have any hooks for that. But we can take help from GitHub API for this.

There are few steps to achieve this: With these values, we can finally make the call by “stringifying” the GraphQL request and substituting bash variables necessary: Here, we are adding the Github token in secrets as mentioned in part-1 of this series.

Related Articles