dotnet / arcade

Tools that provide common build infrastructure for multiple .NET Foundation projects.
MIT License
657 stars 331 forks source link

Read the merge flow configuration from file #14845

Closed f-alizada closed 3 weeks ago

f-alizada commented 3 weeks ago

Changes made

Reason of changing the flow

To improve UX to onboard and create the configuration

Configuration example

{
    "merge-flow-configurations": {
        // The key of the object is source branch
        "release/8.0.3xx": {
           // The branch to which PR should be created
            "MergeToBranch": "release/8.0.4xx",
            // extra switches similar to the https://github.com/dotnet/versions/blob/main/Maestro/subscriptions.json file
            "ExtraSwitches": "-QuietComments"
        },
        "release/8.0.4xx": {
            "MergeToBranch": "main",
            "ExtraSwitches": "-QuietComments"
        }
    }
}

Workflow file example

name: Usage of Inter-branch merge workflow
on: 
  push:
    branches:
      - 'main'
      - 'releases/**'

permissions:
  contents: write
  pull-requests: write

jobs:
  check-script:
    uses: dotnet/arcade/.github/workflows/inter-branch-merge-base.yml@main
    with:
      configuration_file_path: '.config/merge-flow.json'

Checks

The configuration reading step was tested here:

mmitche commented 3 weeks ago

I'm fine with the config file being read from one script, then calling the second script. To me that feels more modular.