From db4e2b13b0f638087681b09ad8a156b9192064ce Mon Sep 17 00:00:00 2001 From: Techassi Date: Fri, 27 Jun 2025 23:19:20 +0200 Subject: [PATCH 1/3] chore: Move action scripts --- .scripts/{ => actions}/get_architecture.sh | 0 .scripts/{ => actions}/get_manifest_digest.sh | 0 .scripts/{ => actions}/get_operator_version.sh | 0 .scripts/{ => actions}/get_repo_digest.sh | 0 .scripts/{ => actions}/shard.py | 0 build-container-image/action.yml | 2 +- build-product-image/action.yml | 2 +- publish-image/action.yml | 2 +- publish-index-manifest/action.yml | 2 +- run-integration-test/action.yml | 2 +- shard/action.yml | 2 +- 11 files changed, 6 insertions(+), 6 deletions(-) rename .scripts/{ => actions}/get_architecture.sh (100%) rename .scripts/{ => actions}/get_manifest_digest.sh (100%) rename .scripts/{ => actions}/get_operator_version.sh (100%) rename .scripts/{ => actions}/get_repo_digest.sh (100%) rename .scripts/{ => actions}/shard.py (100%) diff --git a/.scripts/get_architecture.sh b/.scripts/actions/get_architecture.sh similarity index 100% rename from .scripts/get_architecture.sh rename to .scripts/actions/get_architecture.sh diff --git a/.scripts/get_manifest_digest.sh b/.scripts/actions/get_manifest_digest.sh similarity index 100% rename from .scripts/get_manifest_digest.sh rename to .scripts/actions/get_manifest_digest.sh diff --git a/.scripts/get_operator_version.sh b/.scripts/actions/get_operator_version.sh similarity index 100% rename from .scripts/get_operator_version.sh rename to .scripts/actions/get_operator_version.sh diff --git a/.scripts/get_repo_digest.sh b/.scripts/actions/get_repo_digest.sh similarity index 100% rename from .scripts/get_repo_digest.sh rename to .scripts/actions/get_repo_digest.sh diff --git a/.scripts/shard.py b/.scripts/actions/shard.py similarity index 100% rename from .scripts/shard.py rename to .scripts/actions/shard.py diff --git a/build-container-image/action.yml b/build-container-image/action.yml index 35a6b21..17e79eb 100644 --- a/build-container-image/action.yml +++ b/build-container-image/action.yml @@ -49,7 +49,7 @@ runs: run: | set -euo pipefail - IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/get_architecture.sh") + IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh") echo "IMAGE_ARCH=${IMAGE_ARCH}" | tee -a "$GITHUB_ENV" IMAGE_MANIFEST_TAG="${IMAGE_INDEX_MANIFEST_TAG}-${IMAGE_ARCH}" diff --git a/build-product-image/action.yml b/build-product-image/action.yml index 592c1e7..8235c7a 100644 --- a/build-product-image/action.yml +++ b/build-product-image/action.yml @@ -60,7 +60,7 @@ runs: shell: bash run: | set -euo pipefail - IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/get_architecture.sh") + IMAGE_ARCH=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_architecture.sh") # Will be either: # - 3.9.2-stackable0.0.0-dev-arm64 or diff --git a/publish-image/action.yml b/publish-image/action.yml index 3888a97..5fb76f7 100644 --- a/publish-image/action.yml +++ b/publish-image/action.yml @@ -85,7 +85,7 @@ runs: docker image push "$IMAGE_MANIFEST_URI" # Output for the next step - IMAGE_REPO_DIGEST=$("$GITHUB_ACTION_PATH/../.scripts/get_repo_digest.sh" "$IMAGE_MANIFEST_URI") + IMAGE_REPO_DIGEST=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_repo_digest.sh" "$IMAGE_MANIFEST_URI") echo "IMAGE_REPO_DIGEST=$IMAGE_REPO_DIGEST" | tee -a "$GITHUB_ENV" - name: Sign the container image (${{ env.IMAGE_REPO_DIGEST }}) diff --git a/publish-index-manifest/action.yml b/publish-index-manifest/action.yml index 434070f..5f79715 100644 --- a/publish-index-manifest/action.yml +++ b/publish-index-manifest/action.yml @@ -97,7 +97,7 @@ runs: set -euo pipefail # Get the image index manifest digest - DIGEST=$("$GITHUB_ACTION_PATH/../.scripts/get_manifest_digest.sh" "$IMAGE_INDEX_URI") + DIGEST=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_manifest_digest.sh" "$IMAGE_INDEX_URI") # Construct the image repo digest, which for example contains: # oci.stackable.tech/sdp/kafka@sha256:91... diff --git a/run-integration-test/action.yml b/run-integration-test/action.yml index 7d3fdfe..a01feac 100644 --- a/run-integration-test/action.yml +++ b/run-integration-test/action.yml @@ -196,7 +196,7 @@ runs: run: | set -euo pipefail - OPERATOR_VERSION=$("$GITHUB_ACTION_PATH/../.scripts/get_operator_version.sh" "$REF_NAME") + OPERATOR_VERSION=$("$GITHUB_ACTION_PATH/../.scripts/actions/get_operator_version.sh" "$REF_NAME") python ./scripts/run-tests --skip-tests --operator "$OPERATOR_NAME=$OPERATOR_VERSION" if [ "$INTERU_TEST_RUN" == "all" ]; then diff --git a/shard/action.yml b/shard/action.yml index feb09f3..aca0dd0 100644 --- a/shard/action.yml +++ b/shard/action.yml @@ -35,7 +35,7 @@ runs: CONFIG_FILE: ${{ inputs.config-file }} run: | set -euo pipefail - python "$GITHUB_ACTION_PATH/../.scripts/shard.py" + python "$GITHUB_ACTION_PATH/../.scripts/actions/shard.py" - name: Print Shards shell: bash From 9b49e6056509cb17484b6b768e8433fb1d29a7f7 Mon Sep 17 00:00:00 2001 From: Techassi Date: Fri, 27 Jun 2025 23:22:04 +0200 Subject: [PATCH 2/3] chore: Rename action.yml to action.yaml --- build-container-image/README.md | 2 +- build-container-image/{action.yml => action.yaml} | 0 build-product-image/README.md | 2 +- build-product-image/{action.yml => action.yaml} | 0 free-disk-space/README.md | 6 +++--- free-disk-space/{action.yml => action.yaml} | 0 publish-image/README.md | 2 +- publish-image/{action.yml => action.yaml} | 0 publish-index-manifest/README.md | 2 +- publish-index-manifest/{action.yml => action.yaml} | 0 run-integration-test/README.md | 2 +- run-integration-test/{action.yml => action.yaml} | 0 run-pre-commit/README.md | 2 +- run-pre-commit/{action.yml => action.yaml} | 0 shard/README.md | 2 +- shard/{action.yml => action.yaml} | 0 16 files changed, 10 insertions(+), 10 deletions(-) rename build-container-image/{action.yml => action.yaml} (100%) rename build-product-image/{action.yml => action.yaml} (100%) rename free-disk-space/{action.yml => action.yaml} (100%) rename publish-image/{action.yml => action.yaml} (100%) rename publish-index-manifest/{action.yml => action.yaml} (100%) rename run-integration-test/{action.yml => action.yaml} (100%) rename run-pre-commit/{action.yml => action.yaml} (100%) rename shard/{action.yml => action.yaml} (100%) diff --git a/build-container-image/README.md b/build-container-image/README.md index 85d25ca..3eb792c 100644 --- a/build-container-image/README.md +++ b/build-container-image/README.md @@ -28,4 +28,4 @@ All subsequent tasks must use this value to ensure consistency. - `image-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev-amd64`) - `image-manifest-uri` (eg: `localhost/kafka:3.4.1-stackable0.0.0-dev-amd64`) -[build-container-image]: ./action.yml +[build-container-image]: ./action.yaml diff --git a/build-container-image/action.yml b/build-container-image/action.yaml similarity index 100% rename from build-container-image/action.yml rename to build-container-image/action.yaml diff --git a/build-product-image/README.md b/build-product-image/README.md index 8ffcf2b..1b1098e 100644 --- a/build-product-image/README.md +++ b/build-product-image/README.md @@ -53,4 +53,4 @@ localhost/kafka:3.4.1-stackable0.0.0-dev-amd64 - `image-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev-amd64`) - `suggested-image-index-manifest-tag` (eg: `3.4.1-stackable0.0.0-dev`) -[build-product-image]: ./action.yml +[build-product-image]: ./action.yaml diff --git a/build-product-image/action.yml b/build-product-image/action.yaml similarity index 100% rename from build-product-image/action.yml rename to build-product-image/action.yaml diff --git a/free-disk-space/README.md b/free-disk-space/README.md index a498d94..576927d 100644 --- a/free-disk-space/README.md +++ b/free-disk-space/README.md @@ -22,6 +22,6 @@ None None -[free-disk-space]: ./action.yml -[build-container-image]: ../build-container-image/action.yml -[build-product-image]: ../build-product-image/action.yml +[free-disk-space]: ./action.yaml +[build-container-image]: ../build-container-image/action.yaml +[build-product-image]: ../build-product-image/action.yaml diff --git a/free-disk-space/action.yml b/free-disk-space/action.yaml similarity index 100% rename from free-disk-space/action.yml rename to free-disk-space/action.yaml diff --git a/publish-image/README.md b/publish-image/README.md index f1ff6bb..7a1e9c0 100644 --- a/publish-image/README.md +++ b/publish-image/README.md @@ -37,4 +37,4 @@ following work: None -[publish-image]: ./action.yml +[publish-image]: ./action.yaml diff --git a/publish-image/action.yml b/publish-image/action.yaml similarity index 100% rename from publish-image/action.yml rename to publish-image/action.yaml diff --git a/publish-index-manifest/README.md b/publish-index-manifest/README.md index 478f10e..63ac2f4 100644 --- a/publish-index-manifest/README.md +++ b/publish-index-manifest/README.md @@ -26,4 +26,4 @@ This action creates an image index manifest, publishes it, and signs it. It does None -[publish-index-manifest]: .//action.yml +[publish-index-manifest]: ./action.yaml diff --git a/publish-index-manifest/action.yml b/publish-index-manifest/action.yaml similarity index 100% rename from publish-index-manifest/action.yml rename to publish-index-manifest/action.yaml diff --git a/run-integration-test/README.md b/run-integration-test/README.md index 953c6e5..f256134 100644 --- a/run-integration-test/README.md +++ b/run-integration-test/README.md @@ -108,4 +108,4 @@ profiles: - `end-time` [supported-clusters]: https://docs.replicated.com/vendor/testing-supported-clusters -[run-integration-test]: ./action.yml +[run-integration-test]: ./action.yaml diff --git a/run-integration-test/action.yml b/run-integration-test/action.yaml similarity index 100% rename from run-integration-test/action.yml rename to run-integration-test/action.yaml diff --git a/run-pre-commit/README.md b/run-pre-commit/README.md index 3b61c8d..aae1088 100644 --- a/run-pre-commit/README.md +++ b/run-pre-commit/README.md @@ -49,4 +49,4 @@ jobs: None -[run-pre-commit]: ./action.yml +[run-pre-commit]: ./action.yaml diff --git a/run-pre-commit/action.yml b/run-pre-commit/action.yaml similarity index 100% rename from run-pre-commit/action.yml rename to run-pre-commit/action.yaml diff --git a/shard/README.md b/shard/README.md index e8b3c21..77ef992 100644 --- a/shard/README.md +++ b/shard/README.md @@ -45,4 +45,4 @@ jobs: - `versions` (eg: `["3.7.1", "3.8.0"]`) -[shard]: ./action.yml +[shard]: ./action.yaml diff --git a/shard/action.yml b/shard/action.yaml similarity index 100% rename from shard/action.yml rename to shard/action.yaml From 304ae46c46c17c17f5bc7b646ac1c0776110d81e Mon Sep 17 00:00:00 2001 From: Techassi Date: Fri, 27 Jun 2025 23:48:46 +0200 Subject: [PATCH 3/3] chore: Add pre-commit hook to update links in README --- .pre-commit-config.yaml | 9 +++++++++ .scripts/local/update_readme_list.sh | 22 ++++++++++++++++++++++ README.md | 3 +++ 3 files changed, 34 insertions(+) create mode 100755 .scripts/local/update_readme_list.sh diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4ef31fd..d105575 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -31,3 +31,12 @@ repos: rev: 5db9d9cde2f3deb5035dea3e45f0a9fff2f29448 # 1.7.4 hooks: - id: actionlint + + - repo: local + hooks: + - id: update-readme-list + name: update-readme-list + language: system + entry: .scripts/local/update_readme_list.sh + stages: [pre-commit, pre-merge-commit, manual] + pass_filenames: false diff --git a/.scripts/local/update_readme_list.sh b/.scripts/local/update_readme_list.sh new file mode 100755 index 0000000..81483e1 --- /dev/null +++ b/.scripts/local/update_readme_list.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env bash + +set -euo pipefail + +AUTO_GENERATED_COMMENT="autogenerated by $0" +LIST_TMP=$(mktemp) + +echo "" >> "$LIST_TMP" + +for ACTION in $(find . -mindepth 2 -name action.yaml -print0 | xargs -0 -n 1 dirname | xargs -n 1 basename | sort); do + echo "- [$ACTION](./${ACTION}/README.md)" >> "$LIST_TMP" +done + +echo -n "" >> "$LIST_TMP" + +LIST_CONTENT=$(sed ':a;N;$!ba;s/\n/\\n/g' "$LIST_TMP") +README_TMP=$(mktemp) + +awk "/^ - [build-container-image](./build-container-image/README.md) - [build-product-image](./build-product-image/README.md) - [free-disk-space](./free-disk-space/README.md) @@ -26,4 +27,6 @@ particular step in a workflow. - [publish-index-manifest](./publish-index-manifest/README.md) - [run-integration-test](./run-integration-test/README.md) - [run-pre-commit](./run-pre-commit/README.md) +- [send-slack-notification](./send-slack-notification/README.md) - [shard](./shard/README.md) +