Skip to content

Commit ee267e0

Browse files
authored
feat: Initial draft of migration to issue-based flow
1 parent a7b3369 commit ee267e0

15 files changed

+574
-352
lines changed

.github/dependabot.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/steps/-step.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/steps/0-welcome.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/steps/1-first-codespace.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,3 @@
1-
<!--
2-
<<< Author notes: Step 1 >>>
3-
Choose 3-5 steps for your course.
4-
The first step is always the hardest, so pick something easy!
5-
Link to docs.github.com for further explanations.
6-
Encourage users to open new tabs for steps!
7-
-->
8-
91
## Step 1: Create your first codespace and push code
102

113
_Welcome to "Develop code using GitHub Codespaces and Visual Studio Code"! :wave:_
@@ -50,7 +42,7 @@ To begin developing using GitHub Codespaces, you can create a codespace from a t
5042
1. Use the VS Code terminal to commit the file change by entering the following commit message:
5143

5244
```shell
53-
git commit -a -m "Adding hello from the codespace!"
45+
git commit -a -m 'Adding hello from the codespace!'
5446
```
5547

5648
1. Push the changes back to your repository. From the VS Code terminal, enter:
@@ -61,4 +53,4 @@ To begin developing using GitHub Codespaces, you can create a codespace from a t
6153

6254
1. Your code has been pushed to your repository!
6355
1. Switch back to the homepage of your repository and view the `index.html` to verify the new code was pushed to your repository.
64-
1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
56+
1. With the hello message pushed to GitHub, Mona will begin checking your work. Give her a moment to provide feedback and the next learning steps.

.github/steps/2-custom-image.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<!--
2-
<<< Author notes: Step 2 >>>
3-
Start this step by acknowledging the previous step.
4-
Define terms and link to docs.github.com.
5-
-->
6-
71
## Step 2: Add a custom image to your codespace!
82

93
_Nice work! :tada: You created your first codespace and pushed code using VS Code!_
@@ -21,7 +15,7 @@ Let's add a `devcontainer.json` file and add a custom image.
2115
1. Navigating back to your **Code** tab of your repository, click the **Add file** drop-down button, and then click `Create new file`.
2216
1. Type or paste the following in the empty text field prompt to name your file.
2317

24-
```
18+
```txt
2519
.devcontainer/devcontainer.json
2620
```
2721

@@ -43,12 +37,15 @@ Let's add a `devcontainer.json` file and add a custom image.
4337
1. Create a new codespace by navigating back to the **Code** tab of your repository.
4438
1. Click the green **Code** button located in the middle of the page.
4539
1. Click the **Codespaces** tab on the box that pops up.
46-
1. Click the **Create codespace on main** button OR click the `+` sign on the tab. This will create a new codespace on the main branch. (Notice your other codespace listed here.)
40+
41+
> Notice that our recently codespace is listed.
42+
43+
1. Click the `+` sign on the tab to start another one which is now using our configuration file.
4744

4845
> Wait about **2 minutes** for the codespace to spin itself up.
4946
5047
1. Verify that your new codespace is running, as you did previously.
5148

5249
Note the image being used is the default image provided for GitHub Codespaces. It includes runtimes and tools for Python, Node.js, Docker, and more. See the full list here: https://aka.ms/ghcs-default-image. Your development team can use any custom image that has the necessary prerequisites installed. For more information, see [codespace image](https://aka.ms/configure-codespace).
5350

54-
1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
51+
1. With our dev container configuration committed, Mona will begin checking your work. Give her a moment to provide feedback and the next learning steps.

.github/steps/3-customize-codespace.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<!--
2-
<<< Author notes: Step 3 >>>
3-
Start this step by acknowledging the previous step.
4-
Define terms and link to docs.github.com.
5-
-->
6-
71
## Step 3: Customize your codespace!
82

93
_Nice work! :tada: You created a codespace with a custom image!_
@@ -41,7 +35,7 @@ Let's customize some settings in the `devcontainer.json` file!
4135
1. Ensure the number of active codespaces does not reach the maximum (typically 2). For more information, see [understanding the codespace lifecycle](https://docs.github.com/en/codespaces/getting-started/understanding-the-codespace-lifecycle).
4236

4337
> **Tip**: To stop an active codespace, click the **•••** next to **<span>&#x25cf;</span>Active** and select **Stop codespace** from the menu.
44-
38+
4539
1. Click the **Create codespace on main** button.
4640

4741
> Wait about **2 minutes** for the codespace to spin itself up.
@@ -74,4 +68,4 @@ Next lets add some code to run upon creation of the codespace!
7468
7569
1. Verify your codespace is running, as you did previously.
7670
1. Verify the `codespace.md` file now has the text `Writing code upon codespace creation!`.
77-
1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
71+
1. With the `postCreateCommand` committed, Mona will begin checking your work. Give her a moment to provide feedback and the next learning steps.

.github/steps/4-personalize-codespace.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<!--
2-
<<< Author notes: Step 4 >>>
3-
Start this step by acknowledging the previous step.
4-
Define terms and link to docs.github.com.
5-
-->
6-
71
## Step 4: Personalize your codespace!
82

93
_Nicely done customizing your codespace!_ :partying_face:
@@ -46,6 +40,7 @@ Let's see how this works!
4640
sudo apt-get update
4741
sudo apt-get install sl
4842
echo "export PATH=\$PATH:/usr/games" >> ~/.bashrc
43+
echo "export PATH=\$PATH:/usr/games" >> ~/.zshrc
4944
```
5045

5146
1. Save the file.
@@ -78,4 +73,11 @@ Let's see how this works!
7873
```
7974

8075
1. Enjoy the show!
81-
1. Wait about 20 seconds then refresh this page (the one you're following instructions from). [GitHub Actions](https://docs.github.com/en/actions) will automatically update to the next step.
76+
77+
1. With the `postCreateCommand` committed, Mona will begin checking your work. Give her a moment to provide feedback and the next learning steps.
78+
79+
1. (optional) You created several codespaces during this exercise. Feel free to remove them.
80+
81+
> 💡 **Tip:** If you don't delete them, GitHub will automatically remove them after 30 days of inactivity.
82+
83+
1. (optional) You set your default configuration to install dot files from this exercise repository. We recommend disabling that.

.github/steps/X-finish.md renamed to .github/steps/x-review.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
<!--
2-
<<< Author notes: Finish >>>
3-
Review what we learned, ask for feedback, provide next steps.
4-
-->
5-
61
## Finish
72

83
_Congratulations friend, you've completed this course!_
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Step 0
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
actions: write
11+
issues: write
12+
13+
env:
14+
STEP_1_FILE: ".github/steps/1-first-codespace.md"
15+
16+
jobs:
17+
start_exercise:
18+
if: |
19+
!github.event.repository.is_template
20+
name: Start Exercise
21+
uses: skills/exercise-toolkit/.github/workflows/start-exercise.yml@v0.5.0
22+
with:
23+
exercise-title: "Code with Codespaces"
24+
intro-message: "Define and work on your project in preconfigured development environment."
25+
26+
post_next_step_content:
27+
name: Post next step content
28+
runs-on: ubuntu-latest
29+
needs: [start_exercise]
30+
env:
31+
ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }}
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
37+
- name: Get response templates
38+
uses: actions/checkout@v4
39+
with:
40+
repository: skills/exercise-toolkit
41+
path: exercise-toolkit
42+
ref: v0.5.0
43+
44+
- name: Build comment - add step content
45+
id: build-comment
46+
uses: skills/action-text-variables@v2
47+
with:
48+
template-file: ${{ env.STEP_1_FILE }}
49+
template-vars: |
50+
login: ${{ github.actor }}
51+
full_repo_name: ${{ github.repository }}
52+
53+
- name: Create comment - add step content
54+
run: |
55+
gh issue comment "$ISSUE_URL" \
56+
--body "$ISSUE_BODY"
57+
env:
58+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
59+
ISSUE_BODY: ${{ steps.build-comment.outputs.updated-text }}
60+
61+
- name: Create comment - watching for progress
62+
run: |
63+
gh issue comment "$ISSUE_URL" \
64+
--body-file "exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md"
65+
env:
66+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
68+
- name: Enable next step workflow
69+
run: |
70+
gh workflow enable "Step 1"
71+
env:
72+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/0-welcome.yml

Lines changed: 0 additions & 63 deletions
This file was deleted.

0 commit comments

Comments
 (0)