diff --git a/.github/workflows/1-step.yml b/.github/workflows/1-step.yml index 6bbe70f..c1d3572 100644 --- a/.github/workflows/1-step.yml +++ b/.github/workflows/1-step.yml @@ -64,7 +64,10 @@ 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" + 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 }} diff --git a/.github/workflows/2-step.yml b/.github/workflows/2-step.yml index 3232fd8..eb8c50b 100644 --- a/.github/workflows/2-step.yml +++ b/.github/workflows/2-step.yml @@ -138,7 +138,10 @@ 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" + 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 }} diff --git a/.github/workflows/3-step.yml b/.github/workflows/3-step.yml index 9cf2240..fb29ffa 100644 --- a/.github/workflows/3-step.yml +++ b/.github/workflows/3-step.yml @@ -141,7 +141,10 @@ 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" + 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 }} 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 }} 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.