Skip to content

Commit e9bf0a5

Browse files
authored
Initial commit
0 parents  commit e9bf0a5

21 files changed

+948
-0
lines changed

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"

.github/steps/-step.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0

.github/steps/0-welcome.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<!-- readme -->
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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+
9+
## Step 1: Open a pull request
10+
11+
_Welcome to "Review pull requests"! :wave:_
12+
13+
Let's get started by opening a pull request.
14+
15+
**What is a pull request?**: Collaboration happens on a pull request. The pull request shows the changes in your branch to other people. This pull request is going to keep the changes you just made on your branch and propose applying them to the `main` branch.
16+
17+
### :keyboard: Activity: Create a pull request
18+
19+
1. Click on the **Pull requests** tab in your repository.
20+
2. Click **New pull request**.
21+
3. In the **base:** dropdown, make sure **main** is selected.
22+
4. Select the **compare:** dropdown, and click `update-game`.
23+
5. Click **Create pull request**.
24+
6. Enter a title for your pull request: `Update the game over message`.
25+
7. Enter a description for your pull request: `Update the game over message so people know how to play again!`
26+
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.

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

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
8+
## Step 2: Assign yourself
9+
10+
_Great job opening that pull request! :wave:_
11+
12+
**What is a _pull request review_?**: Reviewing a pull request is an opportunity to examine another contributor's changes and give them feedback. It's an awesome opportunity to learn more about how the project works and how others solve problems.
13+
14+
The best way to get a review is to ask for one. On GitHub, you can ask someone to review a pull request by assigning them as a reviewer or assignee. If you are not ready for review, consider [creating a draft pull request](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request) instead.
15+
16+
### :keyboard: Activity: Assign yourself
17+
18+
1. Open the pull request you just created.
19+
1. Under **Assignees** on the right side of the screen, add yourself.
20+
21+
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:
22+
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.

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

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+
8+
## Step 3: Leave a review
9+
10+
_You assigned yourself! :tada:_
11+
12+
Pull request reviews ensure quality and maintain momentum of changes to your project.
13+
14+
#### When reviewing a pull request:
15+
16+
1. Review the _title_ and _body_ of the pull request, and possibly any associated issue, to understand the intended change.
17+
1. Review the [diff](https://docs.github.com/en/get-started/quickstart/github-glossary#diff), the comparison of the proposed code, in the context of the whole project.
18+
1. For most things, try out the proposed change. Check if the actual change matches the intention. Find the repository's [contributing guide](https://docs.github.com/en/communities/setting-up-your-project-for-healthy-contributions/setting-guidelines-for-repository-contributors) to find out how to review the changes.
19+
20+
#### In your review comments:
21+
22+
- Identify potential issues, risks, and limitations.
23+
- Suggest changes and improvements.
24+
- Share awareness of upcoming changes that the pull request doesn't account for.
25+
- Ask questions to verify shared understanding.
26+
- Highlight what the author did well and should keep doing.
27+
- Prioritize the most important feedback.
28+
- Be concise _and_ provide meaningful detail.
29+
- Treat the pull request author with kindness and empathy.
30+
31+
When an approval or request for changes is not yet needed, consider using **comments**. An **approval** lets the author know you believe the pull request is safe to merge. **Requesting changes** lets the author know you believe the pull request is not ready to merge.
32+
33+
### :keyboard: Activity: Leave a review
34+
35+
1. On the pull request, click **Files changed**.
36+
1. Click **Review changes**.
37+
1. Add a comment with your initial thoughts on the pull request.
38+
1. Select _comment_. You won't be able to _approve_ or _request changes_ to your own pull request.
39+
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.

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

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
7+
## Step 4: Suggest changes
8+
9+
_Nice work reviewing that pull request :sparkles:_
10+
11+
Now that you have explored the different ways you can review a pull request it is time to learn how to use _suggest changes_.
12+
13+
**What is _suggest changes_?**: This feature enables you to recommend a change to a pull request that the author can commit with the push of a button.
14+
15+
### :keyboard: Activity: Suggest changes
16+
17+
1. On the pull request, click **Files changed**.
18+
1. Find the `index.html` changes.
19+
1. Hover your cursor next to the line numbers on the left side of the page.
20+
1. Click the blue plus icon.
21+
1. After the comment form appears, click the **Add a suggestion** button. <br>
22+
![add-a-suggestion-button](https://user-images.githubusercontent.com/97056108/184449714-61e8ee51-824a-48c1-9436-2dfd67f2c070.png)
23+
1. Edit the suggestion.
24+
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.

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

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
7+
## Step 5: Apply suggested changes
8+
9+
_Nicely done suggesting changes! :partying_face:_
10+
11+
Now let's see how easy it is to [apply your suggestion](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request).
12+
13+
### :keyboard: Activity: Apply suggested changes
14+
15+
1. Click **Commit suggestion**.
16+
1. Type a commit message.
17+
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.
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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+
7+
## Step 6: Merge your pull request
8+
9+
_Almost there! :heart:_
10+
11+
You can now [merge](https://docs.github.com/en/get-started/quickstart/github-glossary#merge) your pull request!
12+
13+
### :keyboard: Activity: Merge your pull request
14+
15+
1. Click **Merge pull request**.
16+
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.

.github/steps/X-finish.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!--
2+
<<< Author notes: Finish >>>
3+
Review what we learned, ask for feedback, provide next steps.
4+
-->
5+
6+
## Finish
7+
8+
_Congratulations friend, you've completed this course!_
9+
10+
<img src=https://octodex.github.com/images/hula_loop_octodex03.gif alt=celebrate width=300 align=right>
11+
12+
As you continue working on GitHub, remember that high quality reviews improve your projects. If you are new to a repository, inquire about what review practices they have so you can hit the ground running.
13+
14+
Here's a recap of all the tasks you've accomplished in your repository:
15+
16+
- You learned how to assign pull requests for review.
17+
- You left a review on a pull request.
18+
- You suggested changes to a pull request.
19+
- You applied suggested changes to a pull request.
20+
21+
### What's next?
22+
23+
- Try adding a [`CODEOWNERS`](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners) file to your project to automatically assign reviewers to pull requests.
24+
- We'd love to hear what you thought of this course [in our discussion board](https://github.com/orgs/skills/discussions/categories/review-pull-requests).
25+
- [Take another GitHub Skills course](https://github.com/skills).
26+
- [Read the GitHub Getting Started docs](https://docs.github.com/en/get-started).
27+
- To find projects to contribute to, check out [GitHub Explore](https://github.com/explore).

.github/workflows/0-welcome.yml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Step 0, Welcome
2+
3+
# This step triggers after the learner creates a new repository from the template.
4+
# This workflow updates from step 0 to step 1.
5+
6+
# This will run every time we create push a commit to `main`.
7+
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
8+
on:
9+
workflow_dispatch:
10+
push:
11+
branches:
12+
- main
13+
14+
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
15+
permissions:
16+
# Need `contents: read` to checkout the repository.
17+
# Need `contents: write` to update the step metadata.
18+
# Need `pull-requests: write` to create a pull request.
19+
contents: write
20+
pull-requests: write
21+
22+
jobs:
23+
# Get the current step to only run the main job when the learner is on the same step.
24+
get_current_step:
25+
name: Check current step number
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
- id: get_step
31+
run: |
32+
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
33+
outputs:
34+
current_step: ${{ steps.get_step.outputs.current_step }}
35+
36+
on_start:
37+
name: On start
38+
needs: get_current_step
39+
40+
# We will only run this action when:
41+
# 1. This repository isn't the template repository.
42+
# 2. The step is currently 0.
43+
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
44+
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
45+
if: >-
46+
${{ !github.event.repository.is_template
47+
&& needs.get_current_step.outputs.current_step == 0 }}
48+
49+
# We'll run Ubuntu for performance instead of Mac or Windows.
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
# We'll need to check out the repository so that we can edit the README.
54+
- name: Checkout
55+
uses: actions/checkout@v4
56+
with:
57+
fetch-depth: 0 # Let's get all the branches.
58+
59+
# Create update-game branch, update game, and create pull request for the learner.
60+
- name: Prepare a branch and pull request
61+
run: |
62+
echo "Make sure we are on step 0"
63+
if [ "$(cat .github/steps/-step.txt)" != 0 ]
64+
then
65+
echo "Current step is not 0"
66+
exit 0
67+
fi
68+
69+
echo "Make a branch"
70+
BRANCH=update-game
71+
git checkout -b $BRANCH
72+
73+
echo "Update index.html"
74+
sed -i.bak 's/Game over/Game over, refresh to play again 🧑‍💻 🤖!/' index.html
75+
76+
echo "Make a commit"
77+
git config user.name github-actions[bot]
78+
git config user.email github-actions[bot]@users.noreply.github.com
79+
git add index.html
80+
git commit --message="Update game over message"
81+
82+
echo "Push"
83+
git push --set-upstream origin $BRANCH
84+
85+
echo "Restore main"
86+
git checkout main
87+
env:
88+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
90+
# In README.md, switch step 0 for step 1.
91+
- name: Update to step 1
92+
uses: skills/action-update-step@v2
93+
with:
94+
token: ${{ secrets.GITHUB_TOKEN }}
95+
from_step: 0
96+
to_step: 1
97+
branch_name: update-game
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Step 1, Open a pull request
2+
3+
# This step listens for the learner to open a pull request with branch `update-game`.
4+
# This workflow updates from step 1 to step 2.
5+
6+
# This will run every time we create a branch or tag.
7+
# Reference: https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows
8+
on:
9+
workflow_dispatch:
10+
pull_request:
11+
types:
12+
- opened
13+
- reopened
14+
15+
# Reference: https://docs.github.com/en/actions/security-guides/automatic-token-authentication
16+
permissions:
17+
# Need `contents: read` to checkout the repository.
18+
# Need `contents: write` to update the step metadata.
19+
contents: write
20+
21+
jobs:
22+
# Get the current step to only run the main job when the learner is on the same step.
23+
get_current_step:
24+
name: Check current step number
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
- id: get_step
30+
run: |
31+
echo "current_step=$(cat ./.github/steps/-step.txt)" >> $GITHUB_OUTPUT
32+
outputs:
33+
current_step: ${{ steps.get_step.outputs.current_step }}
34+
35+
on_open_a_pull_request:
36+
name: On open a pull request
37+
needs: get_current_step
38+
39+
# We will only run this action when:
40+
# 1. This repository isn't the template repository.
41+
# 2. The step is currently 1.
42+
# 3. The head branch name is `update-game`.
43+
# Reference: https://docs.github.com/en/actions/learn-github-actions/contexts
44+
# Reference: https://docs.github.com/en/actions/learn-github-actions/expressions
45+
if: >-
46+
${{ !github.event.repository.is_template
47+
&& needs.get_current_step.outputs.current_step == 1
48+
&& github.head_ref == 'update-game' }}
49+
50+
# We'll run Ubuntu for performance instead of Mac or Windows.
51+
runs-on: ubuntu-latest
52+
53+
steps:
54+
# We'll need to check out the repository so that we can edit the README.
55+
- name: Checkout
56+
uses: actions/checkout@v4
57+
with:
58+
fetch-depth: 0 # Let's get all the branches.
59+
ref: update-game # Important, as normally `pull_request` event won't grab other branches.
60+
61+
# In README.md, switch step 1 for step 2.
62+
- name: Update to step 2
63+
uses: skills/action-update-step@v2
64+
with:
65+
token: ${{ secrets.GITHUB_TOKEN }}
66+
from_step: 1
67+
to_step: 2
68+
branch_name: update-game

0 commit comments

Comments
 (0)