I want to set a build webhook when a PullRequest is opened from dev branch to master branch. AWS Codebuild has a webhook based on HEAD_REF
and BASE_REF
which lacks detailed documentation.
What do they stand for?
Thank you for using AWS CodeBuild. For pull request scenarios, HEAD_REF filters on the git reference name of the source branch in the webhook payload that triggers the webhook build, you can find the branch name in "pull_request" -> "head" -> "ref" field in the payload. BASE_REF filters on the git reference name of the destination branch in the payload, you can find the name in "pull_request" -> "base" -> "ref" field.
So for your use case (triggering build when a pr is opened from dev to master branch), you can put the reference name for master branch (e.g. "^refs/heads/master$") in BASE_REF, and reference name for dev branch (e.g. "^refs/heads/dev$") in HEAD_REF. Note the value you put for those two fitlers are regex, so you don't have to use the full name :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With