Skip to content

feat: add check_previous_channel_release composite action#74

Open
duckhawk wants to merge 2 commits into
mainfrom
feat/check-previous-channel-release-main
Open

feat: add check_previous_channel_release composite action#74
duckhawk wants to merge 2 commits into
mainfrom
feat/check-previous-channel-release-main

Conversation

@duckhawk
Copy link
Copy Markdown
Member

Summary

  • Adds a new composite action check_previous_channel_release that verifies the previous release channel exposes the same module tag before promoting to the next channel.
  • Action lifts the logic previously duplicated as .github/check_previous_channel_release.sh in module repositories (e.g. csi-ceph).
  • Improves the version.json parser so it handles both single-line ({"version":"v0.1.14"}) and pretty-printed multi-line output from yq -o=json (newlines and indentation around the keys), via a multiline-aware PCRE grep (grep -aoPz).
  • Updates README.md to list the new action.
  • Mirrors feat: add check_previous_channel_release composite action #73 (same change against v14).

Usage example

- uses: deckhouse/modules-actions/setup@main
  with:
    registry: ${{ vars.PROD_REGISTRY }}
    registry_login: ${{ vars.PROD_MODULES_REGISTRY_LOGIN }}
    registry_password: ${{ secrets.PROD_MODULES_REGISTRY_PASSWORD }}

- uses: deckhouse/modules-actions/check_previous_channel_release@main
  with:
    module_source: "${{ vars.PROD_REGISTRY }}/${{ vars.PROD_MODULE_SOURCE_NAME }}/ce/modules"
    module_name: ${{ vars.MODULE_NAME }}
    module_tag: ${{ github.event.inputs.tag }}
    release_channel: ${{ github.event.inputs.channel }}
    registry: ${{ vars.PROD_REGISTRY }}
    registry_login: license-token
    registry_password: ${{ secrets.PROD_MODULES_READ_REGISTRY_PASSWORD }}

Test plan

  • Locally verified the new grep -aoPz '\{\s*"version"\s*:\s*"[^"]+"\s*\}' | head -z -n 1 | tr -d '\0' | jq -r .version pipeline against:
    • {"version":"v0.1.14"}
    • pretty-printed {\n "version": "v0.1.0"\n}
    • the same JSON embedded in a binary stream with NUL/non-UTF-8 bytes around it
  • Smoke-test by wiring a module repo (e.g. csi-ceph deploy_prod.yml) to check_previous_channel_release@main and triggering a non-alpha channel deploy.

Promotes the per-repository check_previous_channel_release.sh script
into a reusable composite action so module repositories don't have to
ship and maintain their own copy.

The version parser now handles both single-line (`{"version":"v0.1.14"}`)
and pretty-printed multi-line `version.json` produced by yq (newlines
and indentation around the keys), using a multiline-aware PCRE grep.
@duckhawk duckhawk requested a review from Nikolay1224 as a code owner May 13, 2026 08:31
…registry input

The previous-channel image often lives on a read-only mirror that has a
different domain than the registry used to push releases. Swap the
domain portion of `module_source` with the `registry` input before
calling `crane export`, so callers can pass `vars.PROD_REGISTRY_READ`
while keeping `module_source` built from `vars.PROD_REGISTRY`.
@duckhawk
Copy link
Copy Markdown
Member Author

Pushed an additional commit that lets callers point reads at a separate read-only registry: the action now swaps the domain portion of module_source with the registry input before calling crane export, so workflows can pass registry: ${{ vars.PROD_REGISTRY_READ }} while keeping module_source built from vars.PROD_REGISTRY (same change as #75 against v14).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant