diff --git a/.github/workflows/publish-docs-to-s3.yml b/.github/workflows/publish-docs-to-s3.yml index 6c1eb1dd48a1d..c2497e7ecf48f 100644 --- a/.github/workflows/publish-docs-to-s3.yml +++ b/.github/workflows/publish-docs-to-s3.yml @@ -52,7 +52,14 @@ on: # yamllint disable-line rule:truthy required: false default: false type: boolean - + airflow-base-version: + required: false + description: "Override the Airflow Base Version to use for the docs build" + type: string + airflow-version: + required: false + description: "Override the Airflow Version to use for the docs build" + type: string permissions: contents: read jobs: @@ -69,6 +76,8 @@ jobs: DESTINATION: ${{ inputs.destination }} SKIP_WRITE_TO_STABLE_FOLDER: ${{ inputs.skip-write-to-stable-folder }} BUILD_SBOMS: ${{ inputs.build-sboms }} + AIRFLOW_BASE_VERSION: ${{ inputs.airflow-base-version || '' }} + AIRFLOW_VERSION: ${{ inputs.airflow-version || '' }} outputs: include-docs: ${{ inputs.include-docs == 'all' && '' || inputs.include-docs }} destination-location: ${{ steps.parameters.outputs.destination-location }} @@ -102,6 +111,8 @@ jobs: echo "Destination: '${DESTINATION}'" echo "Skip write to stable folder: '${SKIP_WRITE_TO_STABLE_FOLDER}'" echo "Build SBOMs: '${BUILD_SBOMS}'" + echo "Airflow Base Version: '${AIRFLOW_BASE_VERSION}'" + echo "Airflow Version: '${AIRFLOW_VERSION}'" if [[ "${DESTINATION}" == "auto" ]]; then if [[ "${REF}" =~ ^.*[0-9]*\.[0-9]*\.[0-9]*$ ]]; then echo "${REF} looks like final release, using live destination" @@ -118,8 +129,23 @@ jobs: echo "destination-location=s3://staging-docs-airflow-apache-org/docs/" >> ${GITHUB_OUTPUT} fi if [[ " ${INCLUDE_DOCS} " =~ " apache-airflow " ]]; then - AIRFLOW_BASE_VERSION=$(echo "${REF}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') - AIRFLOW_VERSION="${REF}" + if [[ ${AIRFLOW_BASE_VERSION=} == "" ]]; then + echo "No Airflow Base Version provided, using ${REF} to determine it." + set +e + AIRFLOW_BASE_VERSION=$(echo "${REF}" | grep -oE '[0-9]+\.[0-9]+\.[0-9]+') + set -e + if [[ ${AIRFLOW_BASE_VERSION=} == "" ]]; then + echo + echo "No Airflow Base Version found in ${REF}" + echo "You need to force airflow version and airflow base version in the workflow." + echo + exit 1 + fi + fi + if [[ ${AIRFLOW_VERSION=} == "" ]]; then + echo "No Airflow Version provided, using ${REF} to determine it." + AIRFLOW_VERSION="${REF}" + fi echo "airflow-base-version=${AIRFLOW_BASE_VERSION}" >> ${GITHUB_OUTPUT} echo "airflow-version=${AIRFLOW_VERSION}" >> ${GITHUB_OUTPUT} else diff --git a/dev/breeze/doc/images/output_workflow-run_publish-docs.svg b/dev/breeze/doc/images/output_workflow-run_publish-docs.svg index ccb1773b935a5..23f375ca723ff 100644 --- a/dev/breeze/doc/images/output_workflow-run_publish-docs.svg +++ b/dev/breeze/doc/images/output_workflow-run_publish-docs.svg @@ -1,4 +1,4 @@ - +