From 5e8817b21b3bb3e8bbdc707f202189525a84ea1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Wed, 16 Sep 2026 15:06:13 +0200 Subject: [PATCH] chore: dismiss branch-protection bypass MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- .github/workflows/bake_update.yml | 33 ----------------------------- .github/workflows/catalogs.yml | 35 ------------------------------- 2 files changed, 68 deletions(-) diff --git a/.github/workflows/bake_update.yml b/.github/workflows/bake_update.yml index 03c78210..324bb488 100644 --- a/.github/workflows/bake_update.yml +++ b/.github/workflows/bake_update.yml @@ -43,41 +43,8 @@ jobs: git status git diff - - name: Temporarily disable "include administrators" branch protection - if: always() && github.ref == 'refs/heads/main' - id: disable_include_admins - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 - with: - github-token: ${{ secrets.REPO_GHA_PAT }} - script: | - const params = { - owner: 'cloudnative-pg', - repo: 'postgres-containers', - branch: 'main', - }; - const { data } = await github.rest.repos.getAdminBranchProtection(params); - core.setOutput('initial_status', data.enabled); - if (data.enabled) { - await github.rest.repos.deleteAdminBranchProtection(params); - } - - uses: EndBug/add-and-commit@cc9c08ba6c8df3b93a8f2db63e89b98368ae2ae8 # v11 with: author_name: CloudNativePG Automated Updates author_email: noreply@cnpg.com message: 'chore: update PostgreSQL versions' - - - name: Restore "include administrators" branch protection - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 - if: | - always() && - github.ref == 'refs/heads/main' && - steps.disable_include_admins.outputs.initial_status == 'true' - with: - github-token: ${{ secrets.REPO_GHA_PAT }} - script: | - await github.rest.repos.setAdminBranchProtection({ - owner: 'cloudnative-pg', - repo: 'postgres-containers', - branch: 'main', - }); diff --git a/.github/workflows/catalogs.yml b/.github/workflows/catalogs.yml index e543a131..979417eb 100644 --- a/.github/workflows/catalogs.yml +++ b/.github/workflows/catalogs.yml @@ -81,25 +81,6 @@ jobs: author_email: noreply@cnpg.com message: 'chore: update imageCatalogs' - # TODO: remove this step once system images are EOL - - name: Temporarily disable "include administrators" branch protection - if: always() && github.ref == 'refs/heads/main' - id: disable_include_admins - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 - with: - github-token: ${{ secrets.REPO_GHA_PAT }} - script: | - const params = { - owner: 'cloudnative-pg', - repo: 'postgres-containers', - branch: 'main', - }; - const { data } = await github.rest.repos.getAdminBranchProtection(params); - core.setOutput('initial_status', data.enabled); - if (data.enabled) { - await github.rest.repos.deleteAdminBranchProtection(params); - } - # TODO: remove this step once system images are EOL - name: Legacy diff working-directory: postgres-containers @@ -117,19 +98,3 @@ jobs: author_name: CloudNativePG Automated Updates author_email: noreply@cnpg.com message: 'chore: update imageCatalogs' - - # TODO: remove this step once system images are EOL - - name: Restore "include administrators" branch protection - uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9 - if: | - always() && - github.ref == 'refs/heads/main' && - steps.disable_include_admins.outputs.initial_status == 'true' - with: - github-token: ${{ secrets.REPO_GHA_PAT }} - script: | - await github.rest.repos.setAdminBranchProtection({ - owner: 'cloudnative-pg', - repo: 'postgres-containers', - branch: 'main', - });