Skip to content

feat(518): create deploy workflow, check tag name in repositories #2

feat(518): create deploy workflow, check tag name in repositories

feat(518): create deploy workflow, check tag name in repositories #2

name: Deploy on {qualif | recette} server
on:
push:
jobs:
call-main-ci:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: ✅ Check tag exists on repositories
env:
TAG_NAME: 0.0.1-test
GITHUB_TOKEN: ${{ github.token }}
REPO_LIST: |
avenirs-esr/avenirs-cofolio-client
avenirs-esr/avenirs-portfolio-api
shell: bash
run: |
set -euo pipefail
missing=()
export GIT_TERMINAL_PROMPT=0
while IFS= read -r repo; do
[ -z "${repo:-}" ] && continue
echo "🔎 Checking $repo for tag '$TAG_NAME'..."
if git -c http.extraHeader="Authorization: Bearer ${GITHUB_TOKEN}" \
ls-remote --tags --exit-code "https://github.com/${repo}.git" "refs/tags/${TAG_NAME}" >/dev/null 2>&1
then
echo "✔ $repo has tag $TAG_NAME"
else
echo "::warning::$repo is missing tag $TAG_NAME"
missing+=("$repo")
fi
done <<< "$REPO_LIST"
if [ ${#missing[@]} -gt 0 ]; then
echo "missing=${missing[*]}" >> "$GITHUB_OUTPUT"
echo "::error::Missing tag '$TAG_NAME' in: ${missing[*]}"
exit 1
fi