CICD-294 · GitOps pull request automation
Encyclopedia · Advanced GitOps and progressive delivery · All snippets
Previous · CICD-293 · Next · CICD-295
1. Where it fits
- Placement CI run step or authorized lab terminal.
- Prerequisites trusted configuration repository, test cluster and named GitOps controller or rollout controller.
- Platforms kubernetes, local-lab.
- Parameters
CONFIG_REPO,PROMOTION_BRANCH.
2. Copy the snippet
bash
git push origin "HEAD:refs/heads/${PROMOTION_BRANCH:?}"
gh pr create --repo "${CONFIG_REPO:?}" --base main --head "$PROMOTION_BRANCH" --title 'Promote verified staging digest' --body 'Check candidate digest and CI evidence.'3. How it works
The push publishes a reviewed promotion branch, then the CLI opens a PR into the trusted configuration branch. Use stable branch naming to handle retries.
4. Verify the result
Use a dedicated GitHub App and idempotent branch naming. Existing open PRs should be updated or reused.
Validation syntax-validated (Bash parse). Status definitions.