Update PgBouncer version #1329
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Update PgBouncer version | |
| on: | |
| schedule: | |
| - cron: 0 0 * * * | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: 'bash -Eeuo pipefail -x {0}' | |
| permissions: read-all | |
| jobs: | |
| update-pgbouncer: | |
| name: Update PgBouncer version | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5 | |
| with: | |
| token: ${{ secrets.REPO_GHA_PAT }} | |
| - name: Fetch latest PgBouncer version | |
| id: fetch_version | |
| run: | | |
| DISTRO=$(sed -n 's/.*base = "debian:\([^:-]*\).*/\1/p' docker-bake.hcl) | |
| VERSION=$(curl -sSL "http://deb.debian.org/debian/dists/$DISTRO/main/binary-amd64/Packages.xz" \ | |
| | xz -dc \ | |
| | awk '/^Package: pgbouncer$/{show=1} /^Version:/{if(show){print $2; show=0}}' \ | |
| | sort -V \ | |
| | tail -n1) | |
| if [[ -z "$VERSION" ]]; then | |
| echo "No version found for PgBouncer on $DISTRO" | |
| exit 1 | |
| fi | |
| sed -i "s/pgBouncerVersion = \".*\"/pgBouncerVersion = \"${VERSION}\"/" docker-bake.hcl | |
| - name: Diff | |
| run: | | |
| git status | |
| git diff | |
| - name: Temporarily disable "include administrators" branch protection | |
| if: ${{ always() && github.ref == 'refs/heads/main' }} | |
| id: disable_include_admins | |
| uses: benjefferies/branch-protection-bot@af281f37de86139d1c7a27b91176b5dc1c2c827c # v1.1.2 | |
| with: | |
| access_token: ${{ secrets.REPO_GHA_PAT }} | |
| branch: main | |
| enforce_admins: false | |
| - uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9 | |
| with: | |
| author_name: CloudNativePG Automated Updates | |
| author_email: noreply@cnpg.com | |
| message: 'chore: update PgBouncer version' | |
| - name: Enable "include administrators" branch protection | |
| uses: benjefferies/branch-protection-bot@af281f37de86139d1c7a27b91176b5dc1c2c827c # v1.1.2 | |
| if: ${{ always() && github.ref == 'refs/heads/main' }} | |
| with: | |
| access_token: ${{ secrets.REPO_GHA_PAT }} | |
| branch: main | |
| enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }} |