name: Determine pseudo version
description: "Determine go-like pseudo version to use as container image tag."

outputs:
  version:
    description: "Version based on branch name"
    value: ${{ steps.pseudo-version.outputs.version }}
  branchName:
    description: "Branch name"
    value: ${{ steps.pseudo-version.outputs.branchName }}

runs:
  using: "composite"
  steps:
    - name: get version
      id: pseudo-version
      shell: bash
      env:
        WORKSPACE_STATUS_TOOL: ${{ github.workspace }}/tools/workspace_status.sh
      run: |
        version=$(${WORKSPACE_STATUS_TOOL} | grep STABLE_STAMP_VERSION | cut -d ' ' -f2)
        branchName=$(git branch --show-current | tr '/' '-')
        echo "version=v${version}" | tee -a "$GITHUB_OUTPUT"
        echo "branchName=${branchName}" | tee -a "$GITHUB_OUTPUT"
