Skip to content

Conversation

Copy link

Copilot AI commented Jan 20, 2026

Git tags are not available during image builds, preventing custom build scripts from using git describe to generate version-based tags.

Changes

  • Added new input variable build_checkout_fetch_tags (boolean, defaults to false)
  • Updated checkout step in build-and-push-all-images job to use the configurable input
# New input variable
build_checkout_fetch_tags:
  description: 'Fetch git tags during checkout'
  type: boolean
  default: false

# Updated checkout step
- name: 📁 Checkout
  uses: actions/checkout@v4
  with:
    lfs: ${{ inputs.build_checkout_with_lfs }}
    fetch-tags: ${{ inputs.build_checkout_fetch_tags }}

Users can enable git tag fetching by setting build_checkout_fetch_tags: true when calling the workflow. This enables build scripts to access version tags without fetching full repository history (fetch-depth: 0).

Original prompt

This section details on the original issue you should resolve

<issue_title>Fetch tags in build-and-push-images</issue_title>
<issue_description>Make git tags available while building images, allowing build scripts that tag image with the output of git describe to produce tags containing version numbers, and not just hashes.

Maybe like this, or maybe make it configurable:

+++ b/.github/workflows/main-deploy.yml
@@ -132,6 +132,7 @@ jobs:
       uses: actions/checkout@v4
       with:
         lfs: ${{ inputs.build_checkout_with_lfs }}
+        fetch-tags: true

     - name: '🏗️ Build and push image all images'
       uses: aproorg/github-workflows/.github/actions/build-and-push-image@main

</issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: AndriMar <518454+AndriMar@users.noreply.github.com>
Copilot AI changed the title [WIP] Add fetch tags in build-and-push-images workflow Fetch git tags during image builds Jan 20, 2026
Copilot AI requested a review from AndriMar January 20, 2026 09:57
@AndriMar
Copy link
Member

@copilot Make this default false and configurable with input variable.

Co-authored-by: AndriMar <518454+AndriMar@users.noreply.github.com>
Copy link
Author

Copilot AI commented Jan 20, 2026

@copilot Make this default false and configurable with input variable.

Done in 354b7e2. Added build_checkout_fetch_tags input variable with default false.

Copilot AI changed the title Fetch git tags during image builds Add configurable fetch-tags option for image builds Jan 20, 2026
@AndriMar AndriMar marked this pull request as ready for review January 20, 2026 12:01
@AndriMar AndriMar self-requested a review January 20, 2026 12:01
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.

Fetch tags in build-and-push-images

2 participants