Skip to content

Commit d02a51a

Browse files
authored
feat: draft migration to issue-based
1 parent 76d6a1e commit d02a51a

18 files changed

+372
-478
lines changed

.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-open-a-pull-request.md

Lines changed: 1 addition & 9 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: Open a pull request
102

113
_Welcome to "Review pull requests"! :wave:_
@@ -24,4 +16,4 @@ Let's get started by opening a pull request.
2416
6. Enter a title for your pull request: `Update the game over message`.
2517
7. Enter a description for your pull request: `Update the game over message so people know how to play again!`
2618
8. Click **Create pull request**.
27-
9. 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.
19+
9. With the pull request created, Mona will check your progress then prepare and share the next steps.

.github/steps/2-assign-yourself.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +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-
Historic note: this step combines the commend, approve, and needs changes steps from the previous version.
6-
-->
7-
81
## Step 2: Assign yourself
92

103
_Great job opening that pull request! :wave:_
@@ -20,4 +13,4 @@ The best way to get a review is to ask for one. On GitHub, you can ask someone t
2013

2114
Because you created the pull request, you can't assign yourself as a reviewer, but feel free to assign a friend as a reviewer instead to see how it works :smile:
2215

23-
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.
16+
1. With the pull request assigned, Mona will check your progress then prepare and share the next steps.

.github/steps/3-leave-a-review.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +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-
Historic note: this step combines the commend, approve, and needs changes steps from the previous version.
6-
-->
7-
81
## Step 3: Leave a review
92

103
_You assigned yourself! :tada:_
@@ -37,4 +30,4 @@ When an approval or request for changes is not yet needed, consider using **comm
3730
1. Add a comment with your initial thoughts on the pull request.
3831
1. Select _comment_. You won't be able to _approve_ or _request changes_ to your own pull request.
3932
1. Click **Submit review**.
40-
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.
33+
1. With the review submitted, Mona will check your progress then prepare and share the next steps.

.github/steps/4-suggest-changes.md

Lines changed: 1 addition & 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: Suggest changes
82

93
_Nice work reviewing that pull request :sparkles:_
@@ -22,4 +16,4 @@ Now that you have explored the different ways you can review a pull request it i
2216
![add-a-suggestion-button](https://user-images.githubusercontent.com/97056108/184449714-61e8ee51-824a-48c1-9436-2dfd67f2c070.png)
2317
1. Edit the suggestion.
2418
1. Click **Add a single comment**.
25-
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.
19+
1. With commented added, Mona will check your progress then prepare and share the next steps.

.github/steps/5-apply-changes.md

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

93
_Nicely done suggesting changes! :partying_face:_
@@ -15,4 +9,4 @@ Now let's see how easy it is to [apply your suggestion](https://docs.github.com/
159
1. Click **Commit suggestion**.
1610
1. Type a commit message.
1711
1. Click **Commit changes**.
18-
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.
12+
1. With the changes committed, Mona will check your progress then prepare and share the next steps.
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
<!--
2-
<<< Author notes: Step 6 >>>
3-
Start this step by acknowledging the previous step.
4-
Define terms and link to docs.github.com.
5-
-->
6-
71
## Step 6: Merge your pull request
82

93
_Almost there! :heart:_
@@ -14,4 +8,4 @@ You can now [merge](https://docs.github.com/en/get-started/quickstart/github-glo
148

159
1. Click **Merge pull request**.
1610
1. Delete the branch `update-game` (optional).
17-
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.
11+
1. With the pull request merged, Mona will check your progress and prepare a file review. Congrats you are done! 🎉
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
<!--
2-
<<< Author notes: Finish >>>
3-
Review what we learned, ask for feedback, provide next steps.
4-
-->
5-
6-
## Finish
1+
## Review
72

83
_Congratulations friend, you've completed this course!_
94

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
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-open-a-pull-request.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/[email protected]
22+
with:
23+
exercise-title: "Review Pull Requests"
24+
intro-message: "Let's learn to collaborate with others using pull requests."
25+
26+
modify_repo_content:
27+
name: Modify repo 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: Prepare a branch and pull request
38+
run: |
39+
40+
echo "Make a branch"
41+
BRANCH=update-game
42+
git checkout -b $BRANCH
43+
44+
echo "Update index.html"
45+
sed -i.bak 's/Game over/Game over, refresh to play again 🧑‍💻 🤖!/' index.html
46+
47+
echo "Make a commit"
48+
git config user.name github-actions[bot]
49+
git config user.email github-actions[bot]@users.noreply.github.com
50+
git add index.html
51+
git commit --message="Update game over message"
52+
53+
echo "Push"
54+
git push --set-upstream origin $BRANCH
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57+
58+
post_next_step_content:
59+
name: Post next step content
60+
runs-on: ubuntu-latest
61+
needs: [start_exercise]
62+
env:
63+
ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }}
64+
65+
steps:
66+
- name: Checkout
67+
uses: actions/checkout@v4
68+
69+
- name: Get response templates
70+
uses: actions/checkout@v4
71+
with:
72+
repository: skills/exercise-toolkit
73+
path: exercise-toolkit
74+
ref: v0.5.0
75+
76+
- name: Build comment - add step content
77+
id: build-comment
78+
uses: skills/action-text-variables@v2
79+
with:
80+
template-file: ${{ env.STEP_1_FILE }}
81+
template-vars: |
82+
login: ${{ github.actor }}
83+
full_repo_name: ${{ github.repository }}
84+
85+
- name: Create comment - add step content
86+
run: |
87+
gh issue comment "$ISSUE_URL" \
88+
--body "$ISSUE_BODY"
89+
env:
90+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
91+
ISSUE_BODY: ${{ steps.build-comment.outputs.updated-text }}
92+
93+
- name: Create comment - watching for progress
94+
run: |
95+
gh issue comment "$ISSUE_URL" \
96+
--body-file "exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md"
97+
env:
98+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
100+
- name: Enable next step workflow
101+
run: |
102+
gh workflow enable "Step 1"
103+
env:
104+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)