Skip to content

Commit e490ead

Browse files
committed
feat(518): create deploy workflow, check tag name in repositories
1 parent bb8de77 commit e490ead

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Deploy on {qualif | recette} server
2+
on:
3+
push:
4+
5+
jobs:
6+
call-main-ci:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
steps:
11+
- name: ✅ Check tag exists on repositories
12+
env:
13+
TAG_NAME: 0.0.1-test
14+
REPO_LIST: |
15+
avenirs-esr/avenirs-cofolio-client
16+
avenirs-esr/avenirs-portfolio-api
17+
shell: bash
18+
run: |
19+
set -euo pipefail
20+
missing=()
21+
22+
export GIT_TERMINAL_PROMPT=0
23+
24+
while IFS= read -r repo; do
25+
[ -z "${repo:-}" ] && continue
26+
echo "🔎 Checking $repo for tag '$TAG_NAME'..."
27+
28+
if git ls-remote --tags --exit-code "https://github.com/${repo}.git" "refs/tags/${TAG_NAME}" >/dev/null 2>&1
29+
then
30+
echo "✔ $repo has tag $TAG_NAME"
31+
else
32+
echo "::warning::$repo is missing tag $TAG_NAME"
33+
missing+=("$repo")
34+
fi
35+
done <<< "$REPO_LIST"
36+
37+
if [ ${#missing[@]} -gt 0 ]; then
38+
echo "missing=${missing[*]}" >> "$GITHUB_OUTPUT"
39+
echo "::error::Missing tag '$TAG_NAME' in: ${missing[*]}"
40+
exit 1
41+
fi

0 commit comments

Comments
 (0)