diff --git a/.github/workflows/consolidate.yml b/.github/workflows/consolidate.yml new file mode 100644 index 0000000..998b186 --- /dev/null +++ b/.github/workflows/consolidate.yml @@ -0,0 +1,34 @@ +name: Consolidate YAML Files + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + consolidate_yaml: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Consolidate YAML files + uses: mikefarah/yq@v4 + with: + cmd: yq eval-all '. as $item ireduce ([]; . + [$item])' providers/*.yaml > providers.yaml + + - name: Upload providers.yaml as artifact + uses: actions/upload-artifact@v4 + with: + path: providers.yaml + + - name: Commit and push consolidated file + if: github.ref == 'refs/heads/main' + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: "Auto-update providers.yaml" + file_pattern: providers.yaml diff --git a/.github/workflows/validate_yaml.yml b/.github/workflows/validate_yaml.yml new file mode 100644 index 0000000..482ccef --- /dev/null +++ b/.github/workflows/validate_yaml.yml @@ -0,0 +1,24 @@ +name: Validate providers YAMLs + +on: + pull_request: + paths: + - 'providers/**/*.yaml' + +jobs: + validate_yaml: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Yamale + run: | + pip install yamale + + - name: Validate YAML against schema + run: | + for file in providers/*.yaml; do + yamale -s schema.yaml "$file" || exit 1 + done diff --git a/providers/MassaLabs.yaml b/providers/MassaLabs.yaml new file mode 100644 index 0000000..9c1c78c --- /dev/null +++ b/providers/MassaLabs.yaml @@ -0,0 +1,10 @@ +title: Massa Labs Official Provider + +url: https://massa.network/ + +desc: The Official DeWeb Provider hosted by Massa Labs. Only allows access to officials Massa websites and some partner websites. + +owner: Massa Labs + +contact: + email: contact@massa.net diff --git a/schema.yaml b/schema.yaml new file mode 100644 index 0000000..bd0b6b8 --- /dev/null +++ b/schema.yaml @@ -0,0 +1,9 @@ +title: str(required=True) +url: str(required=True, regex='^https?://[\\w.-]+(?:\\.[\\w\\.-]+)+[/\\w\\.-]*$') +desc: str(required=True) +owner: str(required=True) +contact: map(required=True) +contact: + email: str(required=False, regex='^[\\w\\.-]+@[\\w\\.-]+\\.[a-zA-Z]{2,}$') + discord: str(required=False, regex='^@\\w{2,32}#\\d{4}$') + telegram: str(required=False, regex='^@\\w{5,32}$')