Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/dependabot.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/steps/-step.txt

This file was deleted.

1 change: 0 additions & 1 deletion .github/steps/0-welcome.md

This file was deleted.

17 changes: 4 additions & 13 deletions .github/steps/1-resolve-duplicate-issues.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<!--
<<< Author notes: Step 1 >>>
Choose 3-5 steps for your course.
The first step is always the hardest, so pick something easy!
Link to docs.github.com for further explanations.
Encourage users to open new tabs for steps!
-->

## Step 1: Resolve duplicate issues

_Welcome to the course :tada:_

GitHub has special capabilities to help reference other information on GitHub. For example, when you reference another issue or pull request by number, that number will be hyperlinked. At the same time, a cross-reference is created in the linked issue or pull request. This two-way reference helps people track the relationship of information across GitHub.

![a screenshot of an issue linking to a PR, and a PR with a cross-reference to the issue](https://user-images.githubusercontent.com/6351798/172456846-2daec570-08b0-4ffa-a7cb-41acc50b836e.png)
Expand All @@ -24,6 +14,7 @@ When you want to create a crosslink, start typing the title of an issue or pull

### :keyboard: Activity: Find and close the cross-linked issue

1. Navigate to the issue #1 (Welcome)
2. Type "Duplicate of #2" as a comment and close issue #1
3. 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.
1. Navigate to the issue #{{duplicate_issue}} (Welcome)
2. Type "Duplicate of #{{original_issue}}" as a comment and close issue #{{duplicate_issue}}
3. After you close the issue, Mona will prepare the next step in this exercise!

8 changes: 1 addition & 7 deletions .github/steps/2-find-commit-in-history.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<!--
<<< Author notes: Step 2 >>>
Start this step by acknowledging the previous step.
Define terms and link to docs.github.com.
-->

## Step 2: Find a commit in history

_Thanks for the duplicate note :wave:_
Expand All @@ -30,4 +24,4 @@ A SHA is a reference to a specific object. In this case, it's a reference to a c
5. Click the commit message, `add sidebar to documentation` to see the commit details
6. Copy the first seven characters of the SHA (the first 7 characters of the 40 character hexadecimal string listed after `commit`)
7. Comment on issue #2 by adding the SHA from step 6 as a comment text and click on "Comment" button
8. 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.
8. After you comment on the issue, Mona will prepare the next step in this exercise!
21 changes: 9 additions & 12 deletions .github/steps/3-fix-broken-sidebar.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
<!--
<<< Author notes: Step 3 >>>
Start this step by acknowledging the previous step.
Define terms and link to docs.github.com.
-->

## Step 3: Fix a broken sidebar

_Great job finding that commit :heart:_
Expand All @@ -27,13 +21,16 @@ When you're looking at a commit on GitHub, you can see a lot of information. Fro

### :keyboard: Activity: Fix a broken sidebar

1. In the main branch [Edit the `docs/_sidebar.md` file](/docs/_sidebar.md).
1. In the `main` branch, edit the `/docs/_sidebar.md` file.
2. Correct the spelling of the reference `(doc-references__.md)` on line 4 by changing it into `(doc-references.md)`.
3. Select or create a new branch `fix-sidebar` for this commit and start a pull request.
4. Make sure that **main** is selected for **base:** and **fix-sidebar** for **compare:**.
5. Using the **Assignees** section on the right side, assign yourself to the pull request.
6. In the PR comment add 'Closes #2' and autolink issue #2.
![image](https://github.com/user-attachments/assets/efa2c6b1-1d74-48c1-9337-14161dd0f914)


4. Make sure that `main` is selected for `base:` and `fix-sidebar` for `compare:`.
5. Using the `Assignees` section on the right side, assign yourself to the pull request.
6. In the PR comment add `Closes #2` and autolink issue #2.
7. Click **Create pull request** and wait about 20 seconds.
8. Merge this pull request.
9. Delete the branch 'fix-sidebar'.
10. 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.
9. Delete the branch `fix-sidebar`.
10. After you merge the PR and delete the branch, Mona will prepare the next step in this exercise!
9 changes: 1 addition & 8 deletions .github/steps/X-finish.md → .github/steps/x-finish.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
<!--
<<< Author notes: Finish >>>
Review what we learned, ask for feedback, provide next steps.
-->

## Finish

_Congratulations friend, you've completed this course! :tada:_
## Review

<img src="https://octodex.github.com/images/collabocats.jpg" alt=celebrate width=300 align=right>

Expand Down
151 changes: 151 additions & 0 deletions .github/workflows/0-start-exercise.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
name: Step 0

on:
push:
branches:
- main

permissions:
contents: write
actions: write
issues: write

env:
STEP_1_FILE: ".github/steps/1-resolve-duplicate-issues.md"

jobs:
start_exercise:
if: |
!github.event.repository.is_template
name: Start Exercise
uses: skills/exercise-toolkit/.github/workflows/[email protected]
with:
exercise-title: "Connect the Dots"
intro-message: "Let's learn to navigate a GitHub repository effectively!"

create_first_task:
name: Create first task
runs-on: ubuntu-latest
needs: [start_exercise]
env:
ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }}
outputs:
original_issue: ${{ steps.issue_a.outputs.original_issue }}
duplicate_issue: ${{ steps.issue_b.outputs.duplicate_issue }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Create 'Fix broken sidebar' issue (target for duplicate)
id: issue_a
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { data: issue } = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Fix the broken sidebar",
body: "The sidebar in `docs/_sidebar.md` is broken and needs fixing."
});
core.setOutput("original_issue", issue.number);

- name: Create 'Duplicate report' issue (to be closed as duplicate)
id: issue_b
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { data: issue } = await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: "Sidebar bug again",
body: "Looks like the sidebar bug was already reported."
});
core.setOutput("duplicate_issue", issue.number);


prep_repo_content:
name: Prep repo for next step
runs-on: ubuntu-latest
needs: [start_exercise]
env:
ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Prepare files history
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git checkout main
echo "Update _sidebar.md for the 1st time"
cp -f .github/files/_sidebar01.md docs/_sidebar.md
git add docs/_sidebar.md
git commit -m "updated _sidebar.md"
git pull --rebase origin main || true
git push || true
echo "update _sidebar.md for the 2nd time"
cp -f .github/files/_sidebar02.md docs/_sidebar.md
git add docs/_sidebar.md
git commit -m "add sidebar to documentation"
git push
echo "preserve the commit shaw"
git log --all --oneline | grep "add sidebar to documentation" | cut -c 1-7 >> .github/files/SIDEBARCOMMIT
git add .github/files/SIDEBARCOMMIT
git commit -m "created SIDEBARCOMMIT"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

post_next_step_content:
name: Post next step content
runs-on: ubuntu-latest
needs: [start_exercise, create_first_task]
env:
ISSUE_URL: ${{ needs.start_exercise.outputs.issue-url }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Get response templates
uses: actions/checkout@v4
with:
repository: skills/exercise-toolkit
path: exercise-toolkit
ref: v0.3.0

- name: Build comment - add step content
id: build-comment
uses: skills/action-text-variables@v2
with:
template-file: ${{ env.STEP_1_FILE }}
template-vars: |
full_repo_name: ${{ github.repository }}
original_issue: ${{ needs.create_first_task.outputs.original_issue }}
duplicate_issue: ${{ needs.create_first_task.outputs.duplicate_issue }}

- name: Create comment - add step content
run: |
gh issue comment "$ISSUE_URL" \
--body "$ISSUE_BODY"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_BODY: ${{ steps.build-comment.outputs.updated-text }}

- name: Create comment - watching for progress
run: |
gh issue comment "$ISSUE_URL" \
--body-file exercise-toolkit/markdown-templates/step-feedback/watching-for-progress.md
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Enable next step workflow
run: |
gh workflow enable "Step 1"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110 changes: 0 additions & 110 deletions .github/workflows/0-welcome.yml

This file was deleted.

Loading