From b7a4737573cdf3d825ead76c0a8c4319fc02eeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Thu, 19 Sep 2024 16:44:22 +0200 Subject: [PATCH 1/7] Automatic update of the extension list Automatic update of the k6 extension list in the docs/sources/next/extensions/explore.md file in case of changes based on the https://registry.k6.io/registry.json extension registry. The change is pushed to the extension-registry-changed branch and a pull request is opened (or updated) about the change. --- .../workflows/extension-registry-changed.yml | 48 + scripts/extension-registry-changed | 45 + src/data/doc-extensions/extensions.json | 1131 +---------------- 3 files changed, 95 insertions(+), 1129 deletions(-) create mode 100644 .github/workflows/extension-registry-changed.yml create mode 100755 scripts/extension-registry-changed diff --git a/.github/workflows/extension-registry-changed.yml b/.github/workflows/extension-registry-changed.yml new file mode 100644 index 000000000..bf327e322 --- /dev/null +++ b/.github/workflows/extension-registry-changed.yml @@ -0,0 +1,48 @@ +# This workflow keeps the list of extensions up to date +# in the docs/sources/next/extensions/explore.md file. +# +# The workflow is activated by a workflow dispatch event +# of the "extension-registry-changed" type. +# This event is triggered by the grafana/k6-extension-registry +# repository when the extension registry changes. +# +# The list of extensions is generated based on https://registry.k6.io/registry.json. +# If the generated list differs from the previous one, +# it is pushed to the "extension-registry-changed" branch and +# a pull request is created with the change (or updated if it already existed). +# +# It is not a problem if the registry changes several times before merging the pull request, +# the pull request will be updated. The "extension-registry-changed" branch can be deleted +# after merging the pull request, it will be created again if necessary. + +name: extension-registry-changed + +on: + workflow_dispatch: + repository_dispatch: + types: [extension-registry-changed] + +jobs: + update: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Generate Files + run: ${{ github.workspace }}/scripts/extension-registry-changed + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + branch: extension-registry-changed + commit-message: | + Keep files generated from the k6 extension registry up to date + title: | + Update files generated from the k6 Extension Registry + body: | + The [k6 Extension Registry](https://registry.k6.io) has changed. + This pull request contains the files generated from the k6 Extension Registry. + add-paths: | + docs/sources/next/extensions/explore.md diff --git a/scripts/extension-registry-changed b/scripts/extension-registry-changed new file mode 100755 index 000000000..06e30dd97 --- /dev/null +++ b/scripts/extension-registry-changed @@ -0,0 +1,45 @@ +#!/bin/bash + +# This script keeps the list of extensions up to date +# in the docs/sources/next/extensions/explore.md file. +# +# The script is run by the extension-registry.changed.yml +# workflow when the extension registry changes. +# +# The list of extensions is generated based on https://registry.k6.io/registry.json. +# +# In the docs/sources/next/extensions/explore.md file +# the content of the