From 695a925dcc8cb5cdf31cbd89938055ed848d8873 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:47:16 +0200 Subject: [PATCH 01/11] =?UTF-8?q?R=C3=A9parer=20temporairement=20l'=C3=A9t?= =?UTF-8?q?at=20des=20workflows=20du=20cours?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/recover-course-state.yml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/recover-course-state.yml diff --git a/.github/workflows/recover-course-state.yml b/.github/workflows/recover-course-state.yml new file mode 100644 index 0000000..09cc0e3 --- /dev/null +++ b/.github/workflows/recover-course-state.yml @@ -0,0 +1,24 @@ +name: Recovery course state + +on: + push: + branches: + - my-first-branch + paths: + - ".github/workflows/recover-course-state.yml" + +permissions: + actions: write + +jobs: + recover: + runs-on: ubuntu-latest + steps: + - name: Remettre les workflows dans l'état attendu + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -euo pipefail + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/enable" From 60076f7103eabeb6bd66440bc8b035056c6c28bd Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:47:49 +0200 Subject: [PATCH 02/11] =?UTF-8?q?Rendre=20la=20r=C3=A9cup=C3=A9ration=20de?= =?UTF-8?q?s=20workflows=20idempotente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/recover-course-state.yml | 29 +++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/recover-course-state.yml b/.github/workflows/recover-course-state.yml index 09cc0e3..e677497 100644 --- a/.github/workflows/recover-course-state.yml +++ b/.github/workflows/recover-course-state.yml @@ -19,6 +19,29 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -euo pipefail - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/enable" + + ensure_disabled() { + local workflow="$1" + local state + state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}" --jq '.state')" + if [ "$state" = "active" ]; then + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/disable" + else + echo "$workflow déjà désactivé ($state)" + fi + } + + ensure_enabled() { + local workflow="$1" + local state + state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}" --jq '.state')" + if [ "$state" != "active" ]; then + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/enable" + else + echo "$workflow déjà actif" + fi + } + + ensure_disabled "0-start-exercise.yml" + ensure_disabled "1-step.yml" + ensure_enabled "2-step.yml" From 6af2ff67b23003b0d53ffc94c3170b48964016cf Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:48:18 +0200 Subject: [PATCH 03/11] =?UTF-8?q?Nettoyer=20le=20workflow=20temporaire=20d?= =?UTF-8?q?e=20r=C3=A9cup=C3=A9ration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/recover-course-state.yml | 47 ---------------------- 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/recover-course-state.yml diff --git a/.github/workflows/recover-course-state.yml b/.github/workflows/recover-course-state.yml deleted file mode 100644 index e677497..0000000 --- a/.github/workflows/recover-course-state.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Recovery course state - -on: - push: - branches: - - my-first-branch - paths: - - ".github/workflows/recover-course-state.yml" - -permissions: - actions: write - -jobs: - recover: - runs-on: ubuntu-latest - steps: - - name: Remettre les workflows dans l'état attendu - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - set -euo pipefail - - ensure_disabled() { - local workflow="$1" - local state - state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}" --jq '.state')" - if [ "$state" = "active" ]; then - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/disable" - else - echo "$workflow déjà désactivé ($state)" - fi - } - - ensure_enabled() { - local workflow="$1" - local state - state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}" --jq '.state')" - if [ "$state" != "active" ]; then - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/${workflow}/enable" - else - echo "$workflow déjà actif" - fi - } - - ensure_disabled "0-start-exercise.yml" - ensure_disabled "1-step.yml" - ensure_enabled "2-step.yml" From 78a7f294b1c3e5583b68fbe39c2c52504371e180 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:48:45 +0200 Subject: [PATCH 04/11] =?UTF-8?q?Synchroniser=201-step.yml=20avec=20le=20t?= =?UTF-8?q?emplate=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/1-step.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/1-step.yml b/.github/workflows/1-step.yml index 6bbe70f..72a6266 100644 --- a/.github/workflows/1-step.yml +++ b/.github/workflows/1-step.yml @@ -64,7 +64,7 @@ jobs: - name: Passer au workflow suivant run: | - gh workflow disable "${{ github.workflow }}" - gh workflow enable "Step 2" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/enable" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f6fcc4154d96f24f93a1788d16b92b3b80903241 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:48:59 +0200 Subject: [PATCH 05/11] =?UTF-8?q?Synchroniser=202-step.yml=20avec=20le=20t?= =?UTF-8?q?emplate=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/2-step.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/2-step.yml b/.github/workflows/2-step.yml index 3232fd8..cda6ea1 100644 --- a/.github/workflows/2-step.yml +++ b/.github/workflows/2-step.yml @@ -138,7 +138,7 @@ jobs: - name: Passer au workflow suivant run: | - gh workflow disable "${{ github.workflow }}" - gh workflow enable "Step 3" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-step.yml/enable" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From b34b9e24b348f25ac7e210c6065e89fbcbdeed71 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:49:04 +0200 Subject: [PATCH 06/11] =?UTF-8?q?Synchroniser=203-step.yml=20avec=20le=20t?= =?UTF-8?q?emplate=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/3-step.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/3-step.yml b/.github/workflows/3-step.yml index 9cf2240..6a49b4f 100644 --- a/.github/workflows/3-step.yml +++ b/.github/workflows/3-step.yml @@ -141,7 +141,7 @@ jobs: - name: Passer au workflow suivant run: | - gh workflow disable "${{ github.workflow }}" - gh workflow enable "Step 4" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-step.yml/disable" + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/4-last-step.yml/enable" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f4fd55e4c10097397bc7abb53ac42a4964cd22e6 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:49:07 +0200 Subject: [PATCH 07/11] =?UTF-8?q?Synchroniser=204-last-step.yml=20avec=20l?= =?UTF-8?q?e=20template=20corrig=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/4-last-step.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/4-last-step.yml b/.github/workflows/4-last-step.yml index d9c75a1..32b3b79 100644 --- a/.github/workflows/4-last-step.yml +++ b/.github/workflows/4-last-step.yml @@ -61,7 +61,7 @@ jobs: file: ${{ env.REVIEW_FILE }} - name: Désactiver le dernier workflow - run: gh workflow disable "${{ github.workflow }}" + run: gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/4-last-step.yml/disable" env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c94a89cb0f4196b898e9917057555f429d0e7c98 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:49:23 +0200 Subject: [PATCH 08/11] =?UTF-8?q?docs:=20valider=20l'=C3=A9tape=20commit?= =?UTF-8?q?=20du=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/playground/README.md b/playground/README.md index a1e4a42..19e4bff 100644 --- a/playground/README.md +++ b/playground/README.md @@ -5,3 +5,6 @@ Voici ton bac à sable pour le premier commit. - Édite ce fichier sur **ta branche** `my-first-branch` - Ajoute 2–3 lignes sur toi et inclus le mot **Hello** - Enregistre, committe, puis pousse ta branche + +Hello, je teste le parcours GitHub Basics. +Ce commit valide automatiquement l'étape 2 du cours. From 5f5987dfa86ffb90fcb36d18d427338516681e13 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:50:39 +0200 Subject: [PATCH 09/11] Synchroniser la transition idempotente de 1-step.yml --- .github/workflows/1-step.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/1-step.yml b/.github/workflows/1-step.yml index 72a6266..c1d3572 100644 --- a/.github/workflows/1-step.yml +++ b/.github/workflows/1-step.yml @@ -65,6 +65,9 @@ jobs: - name: Passer au workflow suivant run: | gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/enable" + next_state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml" --jq '.state')" + if [ "$next_state" != "active" ]; then + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/enable" + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 8328155724834eb358a7ba42f380479c03f4c526 Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:50:42 +0200 Subject: [PATCH 10/11] Synchroniser la transition idempotente de 2-step.yml --- .github/workflows/2-step.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/2-step.yml b/.github/workflows/2-step.yml index cda6ea1..eb8c50b 100644 --- a/.github/workflows/2-step.yml +++ b/.github/workflows/2-step.yml @@ -139,6 +139,9 @@ jobs: - name: Passer au workflow suivant run: | gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/2-step.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-step.yml/enable" + next_state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/3-step.yml" --jq '.state')" + if [ "$next_state" != "active" ]; then + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-step.yml/enable" + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From a3d7ec6450818398d79b9a8c800de0eb166e3e2b Mon Sep 17 00:00:00 2001 From: Jocelyn Deleuil <101664783+lilblueyes@users.noreply.github.com> Date: Thu, 24 Sep 2026 20:50:45 +0200 Subject: [PATCH 11/11] Synchroniser la transition idempotente de 3-step.yml --- .github/workflows/3-step.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/3-step.yml b/.github/workflows/3-step.yml index 6a49b4f..fb29ffa 100644 --- a/.github/workflows/3-step.yml +++ b/.github/workflows/3-step.yml @@ -142,6 +142,9 @@ jobs: - name: Passer au workflow suivant run: | gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/3-step.yml/disable" - gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/4-last-step.yml/enable" + next_state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/4-last-step.yml" --jq '.state')" + if [ "$next_state" != "active" ]; then + gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/4-last-step.yml/enable" + fi env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}