From 26e810f06ba8412e151ee34a0f2d5408cc9a7866 Mon Sep 17 00:00:00 2001 From: Netanel Baba Date: Mon, 24 Aug 2026 19:32:18 +0300 Subject: [PATCH 1/2] feat: add shared invalidate-changelog-cache composite action Add a composite action that POSTs to the public elementor.com changelog cache invalidate endpoint with an api-key header. Supports explicit types for split beta/dev invalidation, curl timeout, and per-type failure tolerance. Ref: ED-25349 Co-authored-by: Cursor --- actions/invalidate-changelog-cache/action.yml | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 actions/invalidate-changelog-cache/action.yml diff --git a/actions/invalidate-changelog-cache/action.yml b/actions/invalidate-changelog-cache/action.yml new file mode 100644 index 000000000..180b6a369 --- /dev/null +++ b/actions/invalidate-changelog-cache/action.yml @@ -0,0 +1,62 @@ +name: Invalidate changelog cache +description: Bust Elementor.com product changelog transients after a release. + +inputs: + invalidate_token: + description: 'API key sent as api-key header; Hosting WAF validates it.' + required: true + product: + description: 'Changelog product: core or pro.' + required: true + channel: + description: 'Release channel: ga, stable, or beta. Ignored when types is set.' + required: false + default: '' + types: + description: 'Optional space-separated changelog types (release, beta, dev). Overrides channel mapping.' + required: false + default: '' + +runs: + using: "composite" + steps: + - name: Invalidate changelog cache + shell: bash + env: + INVALIDATE_TOKEN: ${{ inputs.invalidate_token }} + PRODUCT: ${{ inputs.product }} + CHANNEL: ${{ inputs.channel }} + TYPES_INPUT: ${{ inputs.types }} + INVALIDATE_URL: https://elementor.com/wp-json/elementor-site-product-changelog/v1/cache/invalidate + run: | + set -euo pipefail + + if [ -z "${INVALIDATE_TOKEN}" ]; then + echo "Changelog cache invalidate token is not configured. Skipping." + exit 0 + fi + + if [ -n "${TYPES_INPUT}" ]; then + TYPES="${TYPES_INPUT}" + else + case "${CHANNEL}" in + ga|stable) TYPES="release" ;; + beta) TYPES="beta dev" ;; + dev) TYPES="dev" ;; + *) + echo "Unknown channel '${CHANNEL}', skipping changelog cache invalidation." + exit 0 + ;; + esac + fi + + for TYPE in ${TYPES}; do + echo "Invalidating changelog cache product=${PRODUCT} type=${TYPE}" + if ! curl --fail --show-error --silent --max-time 60 --request POST \ + --header "Content-Type: application/json" \ + --header "api-key: ${INVALIDATE_TOKEN}" \ + --data "{\"product\":\"${PRODUCT}\",\"type\":\"${TYPE}\"}" \ + "${INVALIDATE_URL}"; then + echo "Warning: failed to invalidate changelog cache type=${TYPE}" + fi + done From 4f0171394a5d148e3dd64aebe9da02f1dfdc769d Mon Sep 17 00:00:00 2001 From: Netanel Baba Date: Wed, 26 Aug 2026 11:04:35 +0300 Subject: [PATCH 2/2] chore: format invalidate-changelog-cache action for prettier Ref: ED-25349 Co-authored-by: Cursor --- actions/invalidate-changelog-cache/action.yml | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/actions/invalidate-changelog-cache/action.yml b/actions/invalidate-changelog-cache/action.yml index 180b6a369..9ad72b33b 100644 --- a/actions/invalidate-changelog-cache/action.yml +++ b/actions/invalidate-changelog-cache/action.yml @@ -2,61 +2,61 @@ name: Invalidate changelog cache description: Bust Elementor.com product changelog transients after a release. inputs: - invalidate_token: - description: 'API key sent as api-key header; Hosting WAF validates it.' - required: true - product: - description: 'Changelog product: core or pro.' - required: true - channel: - description: 'Release channel: ga, stable, or beta. Ignored when types is set.' - required: false - default: '' - types: - description: 'Optional space-separated changelog types (release, beta, dev). Overrides channel mapping.' - required: false - default: '' + invalidate_token: + description: 'API key sent as api-key header; Hosting WAF validates it.' + required: true + product: + description: 'Changelog product: core or pro.' + required: true + channel: + description: 'Release channel: ga, stable, or beta. Ignored when types is set.' + required: false + default: '' + types: + description: 'Optional space-separated changelog types (release, beta, dev). Overrides channel mapping.' + required: false + default: '' runs: - using: "composite" - steps: - - name: Invalidate changelog cache - shell: bash - env: - INVALIDATE_TOKEN: ${{ inputs.invalidate_token }} - PRODUCT: ${{ inputs.product }} - CHANNEL: ${{ inputs.channel }} - TYPES_INPUT: ${{ inputs.types }} - INVALIDATE_URL: https://elementor.com/wp-json/elementor-site-product-changelog/v1/cache/invalidate - run: | - set -euo pipefail + using: 'composite' + steps: + - name: Invalidate changelog cache + shell: bash + env: + INVALIDATE_TOKEN: ${{ inputs.invalidate_token }} + PRODUCT: ${{ inputs.product }} + CHANNEL: ${{ inputs.channel }} + TYPES_INPUT: ${{ inputs.types }} + INVALIDATE_URL: https://elementor.com/wp-json/elementor-site-product-changelog/v1/cache/invalidate + run: | + set -euo pipefail - if [ -z "${INVALIDATE_TOKEN}" ]; then - echo "Changelog cache invalidate token is not configured. Skipping." - exit 0 - fi + if [ -z "${INVALIDATE_TOKEN}" ]; then + echo "Changelog cache invalidate token is not configured. Skipping." + exit 0 + fi - if [ -n "${TYPES_INPUT}" ]; then - TYPES="${TYPES_INPUT}" - else - case "${CHANNEL}" in - ga|stable) TYPES="release" ;; - beta) TYPES="beta dev" ;; - dev) TYPES="dev" ;; - *) - echo "Unknown channel '${CHANNEL}', skipping changelog cache invalidation." - exit 0 - ;; - esac - fi + if [ -n "${TYPES_INPUT}" ]; then + TYPES="${TYPES_INPUT}" + else + case "${CHANNEL}" in + ga|stable) TYPES="release" ;; + beta) TYPES="beta dev" ;; + dev) TYPES="dev" ;; + *) + echo "Unknown channel '${CHANNEL}', skipping changelog cache invalidation." + exit 0 + ;; + esac + fi - for TYPE in ${TYPES}; do - echo "Invalidating changelog cache product=${PRODUCT} type=${TYPE}" - if ! curl --fail --show-error --silent --max-time 60 --request POST \ - --header "Content-Type: application/json" \ - --header "api-key: ${INVALIDATE_TOKEN}" \ - --data "{\"product\":\"${PRODUCT}\",\"type\":\"${TYPE}\"}" \ - "${INVALIDATE_URL}"; then - echo "Warning: failed to invalidate changelog cache type=${TYPE}" - fi - done + for TYPE in ${TYPES}; do + echo "Invalidating changelog cache product=${PRODUCT} type=${TYPE}" + if ! curl --fail --show-error --silent --max-time 60 --request POST \ + --header "Content-Type: application/json" \ + --header "api-key: ${INVALIDATE_TOKEN}" \ + --data "{\"product\":\"${PRODUCT}\",\"type\":\"${TYPE}\"}" \ + "${INVALIDATE_URL}"; then + echo "Warning: failed to invalidate changelog cache type=${TYPE}" + fi + done