Skip to main content

pr-automation

Last updated on

Harness IaCM supports reviewing infrastructure changes via pull request automation. This functionality allows developers to see the changes, such as the plan details, as comments in the PR, so they can see what the resource changes will be before applying the plan. Additionally, Harness IaCM also supports Open Policy Agent (OPA) for more advanced policy enforcement.


Create a PR pipeline

Create a pipeline similar to the way described in the provision workspace topic, and select Pull Request as the operation.


Create a pipeline trigger

Review plan output in pull requests

Once the trigger is defined, create a PR in your git repository. You will see the trigger activation on the Trigger tab:

Trigger activation

You will see the plan as a comment in the PR:

Plan output as PR comment

Security measure for public repositories

As a security measure, comments will not be populated if the repository is public. To override it, add the Environment Variable HARNESS_PASSWORD_API with the git repository token or secret set as the value.