diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 387f7286..2adf220e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,6 +8,11 @@ on: - '.github/**' workflow_dispatch: inputs: + backport-branch: + description: "Select backport branch if different from 'main'" + type: string + default: "main" + required: true target: description: "target chart to release" type: string @@ -22,10 +27,20 @@ on: jobs: build: runs-on: ubuntu-latest + env: + BACKPORT_BRANCH: ${{ github.event.inputs.backport-branch || 'main' }} + CHARTS_DIR: ${{ github.event.inputs.backport-branch == 'main' && 'charts' || 'backports-checkout/charts' }} steps: - name: Checkout uses: actions/checkout@v4 + - name: Checkout Backport branch + uses: actions/checkout@v4 + if: github.event.inputs.backport-branch != 'main' + with: + ref: ${{ env.BACKPORT_BRANCH }} + path: backport-checkout + - name: Configure Git run: | git config user.name "$GITHUB_ACTOR" @@ -68,3 +83,4 @@ jobs: charts_repo_url: https://mongodb.github.io/helm-charts target: ${{ github.event.inputs.target }} dryrun: ${{ github.event.inputs.dryrun }} + charts_dir: ${{ env.CHARTS_DIR }}