Skip to content

Commit 40abd45

Browse files
committed
chore: add action inputs
Signed-off-by: Niccolò Fei <niccolo.fei@enterprisedb.com>
1 parent 2d38075 commit 40abd45

3 files changed

Lines changed: 30 additions & 5 deletions

File tree

.github/actions/generate-catalogs/action.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
name: Generate Image Catalogs
22
description: Generate Image Catalogs
33
inputs:
4-
output-path:
4+
registry:
5+
description: "The registry to interrogate"
6+
required: false
7+
type: string
8+
image-types:
9+
description: "Image types to retrieve - space separated values"
10+
required: false
11+
type: string
12+
distributions:
13+
description: "OS distributions to retrieve - space separated values"
14+
required: false
15+
type: string
16+
regex:
17+
description: "The regular expression used to retrieve container images"
18+
required: false
19+
type: string
20+
output-dir:
521
description: "The path to output directory"
622
required: false
23+
type: string
724
default: "."
825

926
runs:
@@ -23,10 +40,16 @@ runs:
2340
python-version: 3.13
2441

2542
- name: Install Python dependencies
43+
shell: bash
2644
run: |
2745
pip install packaging==25.0 PyYAML==6.0.2
2846
2947
- name: Generate catalogs
48+
shell: bash
3049
run: |
3150
python catalog-generator/.github/catalogs_generator.py \
32-
--output-dir ${{ inputs.output_path }} \
51+
${{ inputs.registry && format('--registry "{0}"', inputs.registry) || '' }} \
52+
${{ inputs.image-types && format('--image-types "{0}"', inputs.image-types) || '' }} \
53+
${{ inputs.distributions && format('--distributions "{0}"', inputs.distributions) || '' }} \
54+
${{ inputs.regex && format('--regex "{0}"', inputs.regex) || '' }} \
55+
--output-dir ${{ inputs.output-dir }}

.github/catalogs_generator.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ def write_catalog(tags, version_re, img_type, os_name, output_dir="."):
154154
digest = get_digest(args.registry, item)
155155
results[major] = [f"{args.registry}:{item}@{digest}"]
156156

157+
if not results:
158+
raise RuntimeError("No results have been found!")
159+
157160
catalog = {
158161
"apiVersion": "postgresql.cnpg.io/v1",
159162
"kind": "ClusterImageCatalog",

.github/workflows/catalogs.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ jobs:
1515
update-catalogs:
1616
runs-on: ubuntu-24.04
1717
steps:
18-
# TODO: remove this step once system images are EOL
1918
- name: Checkout code
2019
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
2120
with:
@@ -31,9 +30,9 @@ jobs:
3130
ref: main
3231

3332
- name: Generate catalogs
34-
uses: ./.github/actions/generate-catalogs
33+
uses: ./postgres-containers/.github/actions/generate-catalogs
3534
with:
36-
output_path: artifacts/image-catalogs/
35+
output-dir: artifacts/image-catalogs/
3736

3837
# TODO: remove this step once system images are EOL
3938
- name: Update legacy catalogs

0 commit comments

Comments
 (0)