Skip to content

Rendre idempotente la transition de 3-step.yml #72

Rendre idempotente la transition de 3-step.yml

Rendre idempotente la transition de 3-step.yml #72

name: Step 0 # Démarrer l'exercice
on:
push:
branches:
- main
permissions:
contents: write
actions: write
issues: write
env:
STEP_1_FILE: ".github/steps/1-step.md"
TOOLKIT_REPOSITORY: "ENSTASIMOV/exercise-toolkit-fr"
TOOLKIT_REF: "main"
jobs:
start_exercise:
if: |
!github.event.repository.is_template
name: Démarrer l'exercice
uses: ENSTASIMOV/exercise-toolkit-fr/.github/workflows/start-exercise.yml@main

Check failure on line 23 in .github/workflows/0-start-exercise.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/0-start-exercise.yml

Invalid workflow file

error parsing called workflow ".github/workflows/0-start-exercise.yml" -> "ENSTASIMOV/exercise-toolkit-fr/.github/workflows/start-exercise.yml@main" (source branch with sha:29df76ddf6eaea521b11f6e6d08209290325a53b) : You have an error in your yaml syntax on line 167
with:
exercise-title: "GitHub Basics"
intro-message: "Ce cours va te guider pas à pas pour découvrir le fonctionnement essentiel de GitHub : branches, commits, pull requests et merge."
manage-workflows: true
post_next_step_content:
name: Afficher l'étape 1
runs-on: ubuntu-latest
needs: [start_exercise]
env:
ISSUE_REPOSITORY: ${{ github.repository }}
ISSUE_NUMBER: ${{ needs.start_exercise.outputs.issue-number }}
steps:
- name: Récupérer le dépôt
uses: actions/checkout@v4
with:
ref: main
- name: Récupérer les templates français
uses: actions/checkout@v4
with:
repository: ${{ env.TOOLKIT_REPOSITORY }}
path: exercise-toolkit-fr
ref: ${{ env.TOOLKIT_REF }}
- name: Publier l'étape 1
uses: GrantBirki/comment@v2.1.1
with:
repository: ${{ env.ISSUE_REPOSITORY }}
issue-number: ${{ env.ISSUE_NUMBER }}
file: ${{ env.STEP_1_FILE }}
- name: Indiquer que la progression est surveillée
uses: GrantBirki/comment@v2.1.1
with:
repository: ${{ env.ISSUE_REPOSITORY }}
issue-number: ${{ env.ISSUE_NUMBER }}
file: exercise-toolkit-fr/markdown-templates/step-feedback/watching-for-progress.md
- name: Passer à l'étape suivante
run: |
gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/0-start-exercise.yml/disable"
next_state="$(gh api "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml" --jq '.state')"
if [ "$next_state" != "active" ]; then
gh api --method PUT "repos/${GITHUB_REPOSITORY}/actions/workflows/1-step.yml/enable"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}