You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 803cbfc
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: .github/workflows/0-start-exercise.yml
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -94,11 +94,12 @@ jobs:
94
94
# Laisse à GitHub le temps d'enregistrer un événement déjà parti.
95
95
sleep 2
96
96
97
-
head_sha="$(gh api "repos/${GITHUB_REPOSITORY}/git/ref/heads/my-first-branch" --jq '.object.sha' 2>/dev/null || true)"
98
-
if [ -n "$head_sha" ]; then
97
+
if head_sha="$(gh api "repos/${GITHUB_REPOSITORY}/git/ref/heads/my-first-branch" --jq '.object.sha' 2>/dev/null)"; then
99
98
run_count="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/1-create-a-branch.yml/runs?branch=my-first-branch&head_sha=$head_sha&per_page=1" --jq '.total_count')"
100
99
if [ "$run_count" -eq 0 ]; then
101
100
echo "La branche existe déjà : lancement immédiat de l'étape 1."
102
101
gh workflow run 1-create-a-branch.yml --ref my-first-branch
103
102
fi
103
+
else
104
+
echo "Aucune branche my-first-branch à rattraper."
0 commit comments