Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 29 additions & 19 deletions .github/workflows/generate_prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,42 @@ on:
permissions: {}

jobs:
list-repositories:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
repositories: ${{ steps.list.outputs.repositories }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# config/repositories.yaml is the single source of truth for the matrix below
- name: List repositories from config/repositories.yaml
id: list
run: |
set -euo pipefail
repos=$(yq -o=json -I=0 '[.repositories[].name]' config/repositories.yaml)
if [ "$(jq 'length' <<< "$repos")" -eq 0 ]; then
echo "::error::No repositories found in config/repositories.yaml"
exit 1
fi
dupes=$(jq -r 'group_by(.)[] | select(length > 1) | .[0]' <<< "$repos")
if [ -n "$dupes" ]; then
echo "::error::Duplicate repository names in config/repositories.yaml: $dupes"
exit 1
fi
echo "repositories=$repos" >> "$GITHUB_OUTPUT"

create-prs:
needs: list-repositories
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
fail-fast: ${{ inputs.fail-fast }}
matrix:
# This should be the list of repository names from config/repositories.yaml:
# yq '.repositories | map(.name)' config/repositories.yaml
repository:
- airflow-operator
- commons-operator
- druid-operator
- hbase-operator
- hdfs-operator
- hive-operator
- kafka-operator
- nifi-operator
- listener-operator
- opa-operator
- opensearch-operator
- secret-operator
- spark-k8s-operator
- superset-operator
- trino-operator
- zookeeper-operator
repository: ${{ fromJSON(needs.list-repositories.outputs.repositories) }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
Expand Down
4 changes: 2 additions & 2 deletions config/repositories.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# If you add a new repository here, you also need to add it to the list of
# repositories in ../.github/workflows/generate_prs.yml.
# This is the single source of truth for the list of repositories.
# ../.github/workflows/generate_prs.yml builds its matrix from the names in here.
#
# chart_description, keywords and artifacthub_category end up in the Helm chart's
# Chart.yaml and are indexed by Artifact Hub and our own Hub. Descriptions deliberately
Expand Down
6 changes: 6 additions & 0 deletions playbook/playbook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
with_fileglob:
- "../config/*.yaml"

- name: Ensure repository names are unique
assert:
that: repositories | map(attribute='name') | unique | length == repositories | length
fail_msg: "Duplicate repository names in config/repositories.yaml"
tags: local

- name: Ensure work directory exists
file:
path: "{{ work_dir }}"
Expand Down
Loading