Skip to content

Commit 384ac93

Browse files
committed
ci: propagate updates to legacy system catalogs
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent bbff9cb commit 384ac93

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

.github/workflows/catalogs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2020
with:
2121
path: postgres-containers
22+
token: ${{ secrets.REPO_GHA_PAT }}
2223

2324
- name: Checkout artifacts
2425
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
@@ -41,6 +42,14 @@ jobs:
4142
run: |
4243
python postgres-containers/.github/catalogs_generator.py --output-dir artifacts/image-catalogs/
4344
45+
# TODO: remove this step once system images are EOL
46+
- name: Update legacy catalogs
47+
run: |
48+
cp artifacts/image-catalogs/catalog-system-bullseye.yaml postgres-containers/Debian/ClusterImageCatalog-bullseye.yaml
49+
cp artifacts/image-catalogs/catalog-system-bookworm.yaml postgres-containers/Debian/ClusterImageCatalog-bookworm.yaml
50+
yq -i '.metadata.name = "postgresql"' postgres-containers/Debian/ClusterImageCatalog-bullseye.yaml
51+
yq -i '.metadata.name = "postgresql"' postgres-containers/Debian/ClusterImageCatalog-bookworm.yaml
52+
4453
- name: Diff
4554
working-directory: artifacts
4655
run: |
@@ -56,3 +65,32 @@ jobs:
5665
author_name: CloudNativePG Automated Updates
5766
author_email: noreply@cnpg.com
5867
message: 'chore: update imageCatalogs'
68+
69+
# TODO: remove this step once system images are EOL
70+
- name: Temporarily disable "include administrators" branch protection
71+
if: ${{ always() && github.ref == 'refs/heads/main' }}
72+
id: disable_include_admins
73+
uses: benjefferies/branch-protection-bot@af281f37de86139d1c7a27b91176b5dc1c2c827c # v1.1.2
74+
with:
75+
access_token: ${{ secrets.REPO_GHA_PAT }}
76+
branch: main
77+
enforce_admins: false
78+
79+
# TODO: remove this step once system images are EOL
80+
- uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9
81+
if: ${{ github.ref == 'refs/heads/main' }}
82+
with:
83+
cwd: 'postgres-containers'
84+
add: 'Debian/*.yaml'
85+
author_name: CloudNativePG Automated Updates
86+
author_email: noreply@cnpg.com
87+
message: 'chore: update imageCatalogs'
88+
89+
# TODO: remove this step once system images are EOL
90+
- name: Enable "include administrators" branch protection
91+
uses: benjefferies/branch-protection-bot@af281f37de86139d1c7a27b91176b5dc1c2c827c # v1.1.2
92+
if: ${{ always() && github.ref == 'refs/heads/main' }}
93+
with:
94+
access_token: ${{ secrets.REPO_GHA_PAT }}
95+
branch: main
96+
enforce_admins: ${{ steps.disable_include_admins.outputs.initial_status }}

0 commit comments

Comments
 (0)