Updating the pull request with a comment after code checking and deploying with the code changes, gives the status SUCCESS or FAILURE as a message in the comment section. So that admin will validate the code status and then proceed with further merging or modification in GitHub.
Execute the below steps to configure “Update PR-OpsMx” Custom Stage.
- 1.Make sure "Update PR-OpsMx" configuration is stored in the orca-local.yml file in the path /home/spinnaker/.hal/default/profiles which is in Halyard pod.
- 2.Update the secrets as follows:
- Updatepr-secrets: It contains the GitHub user credentials of the access token. Edit the secret and provide your details in base64 encoded format. Sample of access token: ZGZ2amtidjM0NmpzZDkzb3Mwc2t3MA==
Note: Github access should have the admin rights to update the PR with comments.
To add “Update PR-OpsMx” stage to your pipeline follow the steps below:
- 1.Go to your application and click “Pipeline builder” and click “Add Stage” and then select “Update PR-OpsMx” stage from the drop-down menu as shown below.
- 2.Now the configuration screen appears to provide the required parameters.Enter the following parameters on the above configuration screen:
- Webhook URL: Provide GitHub API URL to comment in the Pull Request
- Method: POST method is used to comment on Pull Request
- Payload: Comment will be any message. For example, let us say if the build is completed successfully with PR code changes, the message that needs to be sent as a comment looks like “Build process succeeded with the PR. you can merge this code”.
- 3.Once this custom stage has finished running, the comment will appear on the GitHub PR page as shown in the image below.