Skip to content

Commit 8889f27

Browse files
committed
Update workflow triggers
1 parent f101e53 commit 8889f27

7 files changed

Lines changed: 62 additions & 53 deletions

File tree

‎.github/steps/1-step.md‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ A branch is a movable pointer to a sequence of commits. You can experiment freel
1313
3. (Optional CLI)
1414
```bash
1515
git checkout -b my-first-branch
16-
<details> <summary>Having trouble? 🤷</summary><br/>
1716
```
1817

19-
Make sure you’re on the repository page (not your fork list).
18+
<details>
19+
<summary>Having trouble? 🤷</summary><br/>
2020

21-
If using CLI, verify you have Git installed: git --version.
21+
Make sure you’re on the repository page, not your fork list.
22+
If using CLI, verify you have Git installed, `git --version`.
2223

2324
</details>

‎.github/steps/2-step.md‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,18 @@ A commit records a snapshot of your changes with a message explaining **why** yo
1414

1515
(Optional CLI)
1616

17-
````bash
17+
```bash
1818
mkdir -p playground
1919
printf "Hello, I'm learning GitHub Basics!\n" >> playground/README.md
2020
git add playground/README.md
2121
git commit -m "docs: add a short introduction in playground"
2222
git push origin my-first-branch
23-
<details> <summary>Having trouble? 🤷</summary><br/>
23+
```
2424

25-
Ensure you’re on my-first-branch when editing.
25+
<details>
26+
<summary>Having trouble? 🤷</summary><br/>
2627

27-
If committing via the web editor, use a clear message (e.g., “docs: add intro”).
28+
Ensure you’re on `my-first-branch` when editing.
29+
If committing via the web editor, use a clear message, for example “docs: add intro”.
2830

29-
</details> ```
31+
</details>

‎.github/workflows/0-start-exercise.yml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
name: Step 0 # Start Exercise
22

33
on:
4+
# Auto-start lorsque l'élève crée un dépôt depuis la template
5+
push:
6+
branches: [ main ]
7+
# En complément, si la branche par défaut est créée sans commit
8+
create:
9+
# Garde le déclencheur manuel en secours
410
workflow_dispatch:
5-
# NOTE: Enable this if your repo is a template and you want auto-start on first push to main
6-
# push:
7-
# branches: [ main ]
811

912
permissions:
1013
contents: write

‎.github/workflows/1-step.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
name: Step 1
22

33
on:
4+
# Se déclenche quand l'élève crée la branche de l’exercice
5+
create:
6+
# Optionnel, si la branche est créée par un premier push
7+
push:
8+
branches: [ my-first-branch ]
49
workflow_dispatch:
5-
# You can also trigger on branch create/push if desired:
6-
# create:
7-
# push:
810

911
permissions:
1012
contents: read
@@ -18,11 +20,13 @@ env:
1820
jobs:
1921
find_exercise:
2022
name: Find Exercise Issue
23+
if: github.event_name == 'create' && github.event.ref_type == 'branch' && github.event.ref == 'my-first-branch'
2124
uses: skills/exercise-toolkit/.github/workflows/find-exercise-issue.yml@v0.7.1
2225

2326
post_next_step_content:
2427
name: Post next step content
2528
needs: [find_exercise]
29+
if: github.event_name == 'create' && github.event.ref_type == 'branch' && github.event.ref == 'my-first-branch'
2630
runs-on: ubuntu-latest
2731
env:
2832
ISSUE_REPOSITORY: ${{ github.repository }}

‎.github/workflows/2-step.yml‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
name: Step 2
22

33
on:
4+
# Valide automatiquement les commits sur la branche d’exercice
5+
push:
6+
branches: [ my-first-branch ]
7+
paths:
8+
- "playground/**"
49
workflow_dispatch:
5-
# You can also trigger on push to validate right after commits:
6-
# push:
710

811
permissions:
912
contents: write
@@ -97,7 +100,8 @@ jobs:
97100

98101
post_next_step_content:
99102
name: Post next step content
100-
needs: [find_exercise] # or [find_exercise, check_step_work] if you want to gate progression
103+
# Gating, on ne passe à l'étape 3 que si les checks sont OK
104+
needs: [find_exercise, check_step_work]
101105
runs-on: ubuntu-latest
102106
env:
103107
ISSUE_REPOSITORY: ${{ github.repository }}

‎.github/workflows/3-last-step.yml‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
name: Step 3 # Last step of the exercise
22

33
on:
4+
pull_request:
5+
types: [opened, reopened, closed]
46
workflow_dispatch:
5-
# You can also trigger on PR events:
6-
# pull_request:
7-
# types: [opened, reopened, closed]
87

98
permissions:
109
contents: write
@@ -74,7 +73,9 @@ jobs:
7473
finish_exercise:
7574
name: Finish Exercise
7675
needs: [find_exercise, post_review_content]
76+
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
7777
uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.7.1
7878
with:
7979
issue-url: ${{ needs.find_exercise.outputs.issue-url }}
8080
exercise-title: "GitHub Basics"
81+
completion-message: "Congratulations on completing the GitHub Basics exercise! 🎉"

‎README.md‎

Lines changed: 27 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,44 @@
1-
# GitHub Basics
1+
<header>
22

3-
Learn the essential GitHub flow:
3+
# Introduction à GitHub
44

5-
1. Create a branch
6-
2. Commit a file
7-
3. Open a pull request
8-
4. Merge your pull request
5+
_Démarre sur GitHub en moins d’une heure._
96

10-
## Who is this for
7+
</header>
118

12-
New contributors who want a hands-on, guided introduction to GitHub collaboration.
9+
## Bienvenue
1310

14-
## What you'll learn
11+
Des jeux vidéo aux expériences data, GitHub propulse certains des projets les plus avancés. Que tu débutes ou que tu aies juste besoin d’un rappel, ce mini cours “Introduction à GitHub” te guide pas à pas pour contribuer rapidement.
1512

16-
- Repositories, branches, commits, and pull requests
17-
- Writing meaningful commit messages
18-
- Reviewing and merging a pull request
13+
- **Pour qui**: nouveaux développeurs, nouveaux utilisateurs GitHub, étudiants.
14+
- **Ce que tu vas apprendre**: dépôts, branches, commits, pull requests.
15+
- **Ce que tu vas construire**: une petite modification de documentation proposée via une pull request.
16+
- **Prérequis**: aucun, un compte GitHub suffit.
17+
- **Durée**: moins d’une heure.
1918

20-
## What you'll build
19+
Dans ce cours, tu vas:
2120

22-
A small documentation change in this repository, proposed through a pull request.
21+
1. Créer une branche
22+
2. Commiter un fichier
23+
3. Ouvrir une pull request
24+
4. Merger ta pull request
2325

24-
## Prerequisites
26+
### Comment démarrer le cours
2527

26-
- A GitHub account
27-
- No command line or coding experience required (CLI tips are included, but optional)
28+
> Important, **clique sur le bouton ci-dessous** pour créer un **nouveau dépôt depuis la template**. N’utilise pas “Fork”, sinon les Actions risquent de ne pas se lancer automatiquement. Les dépôts privés consomment des minutes GitHub Actions.
2829
29-
## How long
30+
[![Commencer le cours](https://img.shields.io/badge/Commencer%20le%20cours-%E2%86%92-1f883d?style=for-the-badge&logo=github&labelColor=197935)](https://github.com/new?template_owner=clubrobenstabrest&template_name=github-basics&owner=%40me&name=github-basics&description=Exercice%3A%20GitHub%20Basics&visibility=public)
3031

31-
This exercise typically takes **15–30 minutes**.
32+
1. Clic droit sur **Commencer le cours** puis “Ouvrir le lien dans un nouvel onglet”.
33+
2. Dans le nouvel onglet, la plupart des champs sont préremplis, choisis le propriétaire du dépôt.
34+
3. Clique sur **Create repository** en bas du formulaire.
35+
4. Attends environ **20 secondes**, puis **rafraîchis** la page, les instructions étape par étape apparaîtront dans les Issues.
3236

33-
## How to start this exercise
34-
35-
Copy this exercise to your account, wait about **20 seconds**, then refresh the page:
36-
[![](https://img.shields.io/badge/Copy%20Exercise-%E2%86%92-1f883d?style=for-the-badge&logo=github&labelColor=197935)](https://github.com/new?template_owner=clubrobenstabrest&template_name=github-basics&owner=%40me&name=github-basics&description=Exercise%3A%20GitHub%20Basics&visibility=public)
37-
38-
<details>
39-
<summary>Having trouble? 🤷</summary><br/>
40-
41-
- Choose your personal account (or an organization) as the owner.
42-
- Public repositories are recommended (private repos consume Actions minutes).
43-
- If it isn’t ready in 20s, open the <a href="../../actions">Actions</a> tab to check the run.
44-
- If a job failed, please open an issue — you found a bug! 🐛
37+
---
4538

46-
</details>
39+
## Support
4740

48-
---
41+
Besoin d’aide, ouvre une issue dans ce dépôt.
42+
Statut de GitHub, [status.github.com](https://www.githubstatus.com/)
4943

5044
&copy; 2025 GitHub • [Code of Conduct](https://www.contributor-covenant.org/version/2/1/code_of_conduct/code_of_conduct.md) • [MIT License](https://gh.io/mit)

0 commit comments

Comments
 (0)