1
0
mirror of synced 2025-12-19 18:14:56 -05:00

fix: publish latest tag for python connectors on main release (#68199)

## What
Because of this default setting [the logic to determine whether to push
the `latest` tag
](032869af01/.github/actions/connector-image-build-push/action.yml (L148-L149))on
connector images was evaluating to "false" even for "main releases"
(i.e. merging to master with a non pre-release or RC tag). This is
unintended behavior.

Here's an
[example](https://github.com/airbytehq/airbyte/actions/runs/18568223627/job/52935068035#step:18:394)
of a connector release where is was working incorrectly.

Testing:
- I ran a manual main-release publish workflow
[here](https://github.com/airbytehq/airbyte/actions/runs/18660728140)
and looked at the logs to ensure the latest logic was evaluated
properly. The image version for the chosen connector already exists on
Dockerhub, so we wont attempt to republish.
- I ran a manual pre-release publish workflow
[here](https://github.com/airbytehq/airbyte/actions/runs/18660880512)
and made sure no latest-tag was added

## Can this PR be safely reverted and rolled back?
<!--
* If unsure, leave it blank.
-->
- [x] YES 💚
- [ ] NO 
This commit is contained in:
David Gold
2025-10-20 12:51:54 -07:00
committed by GitHub
parent 4965fca525
commit 8831858199

View File

@@ -20,10 +20,9 @@ inputs:
description: "Override the image tag (optional). If not provided, the tag will be derived from the connector metadata.yaml."
required: false
default: ""
push-latest:
description: "if pushing the image, to a remote registry, also push it with the latest tag"
push-latest-tag:
description: "Override the default behavior and if publishing an image, determine whether to tag it with latest in addition to the version tag. If not provided, the action will determine based on release-type."
required: false
default: "false"
dry-run:
description: "Dry run mode (build but do not push)"
required: false
@@ -131,6 +130,9 @@ runs:
# Check if this is a release candidate
IS_RELEASE_CANDIDATE=$(poe -qq get-version | grep -q 'rc' && echo "true" || echo "false")
if [[ "$IS_RELEASE_CANDIDATE" == "true" ]]; then
echo " Detected release candidate version: $CONNECTOR_VERSION"
fi
# Determine the image tags to use
if [[ "${{ inputs.tag-override }}" ]]; then
@@ -146,18 +148,18 @@ runs:
fi
# Determine whether to push with latest tag
if [[ "${{ inputs.push-latest }}" == "true" || "${{ inputs.push-latest }}" == "false" ]]; then
if [[ "${{ inputs.push-latest-tag }}" == "true" || "${{ inputs.push-latest-tag }}" == "false" ]]; then
# Use explicit input value
PUSH_LATEST="${{ inputs.push-latest }}"
echo "🏷 Using explicit push-latest setting: $PUSH_LATEST"
PUSH_LATEST_TAG="${{ inputs.push-latest-tag }}"
echo "🏷 Using explicit push-latest-tag setting: $PUSH_LATEST_TAG"
else
# Auto-determine based on release-type and release candidate status
if [[ "${{ inputs.release-type }}" == "pre-release" || "$IS_RELEASE_CANDIDATE" == "true" ]]; then
PUSH_LATEST="false"
echo "🏷 Skipping latest tag for pre-release or release candidate build"
else
PUSH_LATEST="true"
if [[ "${{ inputs.release-type }}" == "main-release" && "$IS_RELEASE_CANDIDATE" == "false" ]]; then
PUSH_LATEST_TAG="true"
echo "🏷 Will push with latest tag for main release"
else
PUSH_LATEST_TAG="false"
echo "🏷 Skipping latest tag for pre-release or release candidate build"
fi
fi
@@ -187,7 +189,7 @@ runs:
# Get all tags to use for image pushing
DOCKER_TAGS="${FULL_IMAGE_NAME}"
if [[ "$PUSH_LATEST" == "true" ]]; then
if [[ "$PUSH_LATEST_TAG" == "true" ]]; then
DOCKER_TAGS="${DOCKER_TAGS},${{ inputs.registry }}/${CONNECTOR_NAME}:latest"
fi
@@ -199,7 +201,7 @@ runs:
echo " Registry: ${{ inputs.registry }}"
echo " Full Image Name: $FULL_IMAGE_NAME"
echo " Release Type: ${{ inputs.release-type }}"
echo " Push Latest: $PUSH_LATEST"
echo " Push Latest Tag: $PUSH_LATEST_TAG"
echo " Dry Run: ${{ inputs.dry-run }}"
echo " Force Publish: ${{ inputs.force-publish }}"