diff --git a/.github/workflows/helmchart_on_release.yml b/.github/workflows/helmchart_on_release.yml index b3bc4e8c2f..0a4ee872ce 100644 --- a/.github/workflows/helmchart_on_release.yml +++ b/.github/workflows/helmchart_on_release.yml @@ -57,6 +57,23 @@ jobs: APP_VERSION=${APP_VERSION%/} sed -i "s/appVersion: .*/appVersion: $APP_VERSION/" ./charts/windmill/Chart.yaml + - name: Close existing bump-helm PRs + env: + GH_TOKEN: ${{ steps.app.outputs.token }} + run: | + # List open PR numbers whose title starts with the prefix + prs=$(gh pr list \ + --state open \ + --search '"helm: bump version to" in:title' \ + --json number \ + -q '.[].number') + + for pr in $prs; do + echo "Closing outdated bump PR #$pr" + gh pr close "$pr" \ + --comment "Closed automatically – superseded by a newer Helm-chart bump PR." + done + - name: Commit and push run: | git add .