diff --git a/.github/workflows/bake.yml b/.github/workflows/bake.yml index efbbfb0..22d9800 100644 --- a/.github/workflows/bake.yml +++ b/.github/workflows/bake.yml @@ -7,12 +7,7 @@ on: extension_name: description: "The PostgreSQL extension to build (directory name)" required: true - type: choice - options: - - pgvector - - postgis - - pgaudit - - pg-crash + type: string defaults: run: @@ -33,6 +28,43 @@ jobs: with: persist-credentials: false + - name: Fetch valid targets + id: get-targets + uses: dagger/dagger-for-github@27b130bf0f79a7f6fbbbe0fbca6760dc9bb40a77 # v8.4.1 + env: + # renovate: datasource=github-tags depName=dagger/dagger versioning=semver + DAGGER_VERSION: 0.20.6 + with: + version: ${{ env.DAGGER_VERSION }} + verb: call + module: ./dagger/maintenance/ + args: get-targets + + - name: Validate extension name + if: github.event_name == 'workflow_dispatch' + env: + INPUT_EXTENSION_NAME: ${{ github.event.inputs.extension_name }} + VALID_TARGETS: ${{ steps.get-targets.outputs.output }} + run: | + if ! echo "$VALID_TARGETS" | jq -e --arg ext "$INPUT_EXTENSION_NAME" 'index($ext)' > /dev/null; then + echo "::error::'$INPUT_EXTENSION_NAME' is not a valid extension target. Valid targets: $VALID_TARGETS" + exit 1 + fi + + - name: Compute paths-filter extensions block + env: + VALID_TARGETS: ${{ steps.get-targets.outputs.output }} + run: | + if ! echo "$VALID_TARGETS" | jq -e 'length > 0' > /dev/null; then + echo "::error::dagger get-targets returned no extensions: $VALID_TARGETS" + exit 1 + fi + { + echo 'EXTENSIONS<> "$GITHUB_ENV" + - name: Check for changes uses: dorny/paths-filter@fbd0ab8f3e69293af611ebaee6363fc25e6d187d # v4.0.1 id: filter @@ -42,19 +74,9 @@ jobs: - 'docker-bake.hcl' - 'Taskfile.yml' - 'test/**' - - '.github/workflows/bake*.yml' - pgvector: - - 'pgvector/**' - - *shared - postgis: - - 'postgis/**' - - *shared - pgaudit: - - 'pgaudit/**' - - *shared - pg-crash: - - 'pg-crash/**' - - *shared + - 'dagger/maintenance/**' + - '.github/workflows/bake_targets.yml' + ${{ env.EXTENSIONS }} # Compute a matrix containing the list of all extensions that have been modified - name: Compute matrix diff --git a/CONTRIBUTING_NEW_EXTENSION.md b/CONTRIBUTING_NEW_EXTENSION.md index af55c8c..d3568f2 100644 --- a/CONTRIBUTING_NEW_EXTENSION.md +++ b/CONTRIBUTING_NEW_EXTENSION.md @@ -15,17 +15,17 @@ Before proposing a change, ensure your local machine is compatible with the 1. **Fork** the [cloudnative-pg/postgres-extensions-containers](https://github.com/cloudnative-pg/postgres-extensions-containers) repository. 2. **Clone** your fork and enter the directory: -```sh -git clone https://github.com//postgres-extensions-containers.git -cd postgres-extensions-containers -``` + ```sh + git clone https://github.com//postgres-extensions-containers.git + cd postgres-extensions-containers + ``` 3. **Verify the Environment:** Run the following to ensure you can build the existing project ecosystem. -```sh -task prereqs # Check if Go, Task, and Docker are ready -task checks:all # Validate current configurations -task bake:all # Optional: build all existing extensions to confirm the Dagger engine -``` + ```sh + task prereqs # Check if Go, Task, and Docker are ready + task checks:all # Validate current configurations + task bake:all # Optional: build all existing extensions to confirm the Dagger engine + ``` --- diff --git a/renovate.json b/renovate.json index efac5b4..edcec7d 100644 --- a/renovate.json +++ b/renovate.json @@ -48,10 +48,11 @@ "datasourceTemplate": "deb" }, { - "description": "updates the Taskfile dependencies", + "description": "updates the Taskfile and GitHub Actions workflow dependencies", "customType": "regex", "managerFilePatterns": [ - "Taskfile.yml" + "Taskfile.yml", + ".github/workflows/*.yml" ], "matchStrings": [ "# renovate: datasource=(?[a-z-.]+?) depName=(?[^\\s]+?)(?: (?:lookupName|packageName)=(?[^\\s]+?))?(?: versioning=(?[^\\s]+?))?(?: extractVersion=(?[^\\s]+?))?(?: currentValue=(?[^\\s]+?))?\\s+[A-Za-z0-9_]+?_SHA\\s*:\\s*[\"']?(?[a-f0-9]+?)[\"']?\\s",