DivZ
DivZ

Reputation: 738

How to push changes to a GitHub branch after PR is already in the merge queue?

I have a script that automates Azure subscription creation by opening PRs across two different GitHub repositories.

Repositories & File Structure:

Repo 1 - subscription.yaml

---
name: "Contoso - NonProd - Sub-Test-51"
subscriptionId: "subscription_guid_placeholder"
default_subscription_access_entra_group: "azure-sub-entra_id_placeholder"
tags:
  owner_team: "infra-team"
parent_management_group_id: "/providers/Microsoft.Management/managementGroups/CONTOSO-NONPROD"
Repo 2 - azure-sub-subscription_guid_placeholder.yaml

---
description = Users with access to `Contoso - NonProd - Sub-Test-51` Azure subscription
group = contoso/infra-team-members

How the Process Works

  1. A PR is opened in Repo 1 with subscription.yaml.
  2. Once approved, it enters the merge queue.
  3. A deployment app (running in an internal Kubernetes environment, not GitHub Actions) provisions the Azure subscription.
  4. Only after the deployment is complete, the actual subscriptionId is known.

Goals

Challenges

Ideas I've Considered (But Don't Like)

1. Maintain an External State (e.g., Database or Azure Table Storage)

2. Push Changes from the Deployment App to My Own Branch

3. Use an Azure Subscription Tag to Store the File Path

4. Push Changes to a Different Branch, Auto-Approve, Deploy, and Merge

Best Approach?

Tbh this might not even be possible would be good to know if anybody knows the best way to achieve this while keeping everything within a single PR?

Upvotes: 0

Views: 44

Answers (0)

Related Questions