Skip to content

Docker releasebranch condition check #6750

@echoix

Description

@echoix

@neteler I might need some imagination on grep patterns/bash scripting.
In the docker workflow, where I check if it is a releasebranch, I'm matching the branch pattern name used by renovate:

      - name: Get the latest tag and release branches
        id: tag-branch
        run: |
          # Make sure tags are fetched
          git fetch --tags
          # Get sorted list of tags, keep the first that has a semver pattern (not RCs)
          latest_tag="$(git tag --sort=-v:refname \
            | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \
            | head -n 1)"
          echo "latest_tag=${latest_tag}" >> "${GITHUB_OUTPUT}"
          echo "latest_tag is: ${latest_tag}"
          if [ -z "$latest_tag" ]; then
              echo "Error getting latest tag information"
              echo "error_latest=yes" >> "${GITHUB_OUTPUT}"
              exit 0
          fi
          latest_rel_branch="$(git branch --all --list 'origin/*' \
            --contains "${latest_tag}" --format "%(refname:lstrip=3)" || echo "")"
          echo "latest_rel_branch=${latest_rel_branch}" >> "${GITHUB_OUTPUT}"
          echo "latest_rel_branch is: ${latest_rel_branch}"
          if [ -z "$latest_rel_branch" ]; then
              echo "Error getting latest release branch information"
              echo "error_latest_rel_branch=yes" >> "${GITHUB_OUTPUT}"
              exit 0
          fi
          echo "error_latest=no" >> "${GITHUB_OUTPUT}"
          echo "error_latest_rel_branch=no" >> "${GITHUB_OUTPUT}"

In this run, it fails: https://github.com/OSGeo/grass/actions/runs/20349843427/job/58471362621

0s
Run # Make sure tags are fetched
  # Make sure tags are fetched
  git fetch --tags
  # Get sorted list of tags, keep the first that has a semver pattern (not RCs)
  latest_tag="$(git tag --sort=-v:refname \
    | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \
    | head -n 1)"
  echo "latest_tag=${latest_tag}" >> "${GITHUB_OUTPUT}"
  echo "latest_tag is: ${latest_tag}"
  if [ -z "$latest_tag" ]; then
      echo "Error getting latest tag information"
      echo "error_latest=yes" >> "${GITHUB_OUTPUT}"
      exit 0
  fi
  latest_rel_branch="$(git branch --all --list 'origin/*' \
    --contains "${latest_tag}" --format "%(refname:lstrip=3)" || echo "")"
  echo "latest_rel_branch=${latest_rel_branch}" >> "${GITHUB_OUTPUT}"
  echo "latest_rel_branch is: ${latest_rel_branch}"
  if [ -z "$latest_rel_branch" ]; then
      echo "Error getting latest release branch information"
      echo "error_latest_rel_branch=yes" >> "${GITHUB_OUTPUT}"
      exit 0
  fi
  echo "error_latest=no" >> "${GITHUB_OUTPUT}"
  echo "error_latest_rel_branch=no" >> "${GITHUB_OUTPUT}"
  shell: /usr/bin/bash -e {0}
latest_tag is: 8.4.2
latest_rel_branch is: releasebranch_8_4
renovate/releasebranch_8_4-actions-download-artifact-4.x
renovate/releasebranch_8_4-actions-upload-artifact-4.x
Error: Unable to process file command 'output' successfully.
Error: Invalid format 'renovate/releasebranch_8_4-actions-download-artifact-4.x'

Any ideas anyone? Ideally to implement before tomorrow end of UTC day.

Originally posted by @echoix in #6746 (comment)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions