Skip to content
Merged
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
46 changes: 19 additions & 27 deletions .github/workflows/start-exercise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,35 +102,27 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Deactivate 'Copy Exercise' button
run: |
# Remove href from 'Copy Exercise' button
target='id="copy-exercise"[^>]*href="[^"]*"'
replacement='id="copy-exercise"'
sed -i "s|$target|$replacement|g" README.md

# Change color from green to gray
target=Copy_Exercise-008000
replacement=Copy_Exercise-AAA
sed -i "s|$target|$replacement|g" README.md

- name: Activate 'Start Exercise' button
run: |
# Add link to issue
target='id="start-exercise"'
replacement='id="start-exercise" href="../../issues/${{ needs.create_exercise.outputs.issue-number }}"'
sed -i "s|$target|$replacement|g" README.md
- name: Get response templates
uses: actions/checkout@v4
with:
repository: skills/exercise-toolkit
path: exercise-toolkit
ref: v0.2.0

# Change color from gray to green
target=Start_Exercise-AAA
replacement=Start_Exercise-008000
sed -i "s|$target|$replacement|g" README.md
- name: Build welcome message from template
id: build-new-readme
uses: skills/action-text-variables@v1
with:
template-file: exercise-toolkit/markdown-templates/readme/exercise-started.md
template-vars: |
title=${{ inputs.exercise-title }}
login=${{ github.actor }}
issue_url=${{ needs.create_exercise.outputs.issue-url }}

- name: Replace relative links
run: |
target=../../
replacement=https://github.com/${{ github.repository }}/
sed -i "s|$target|$replacement|g" README.md
- name: Overwrite README
env:
README_TEXT: ${{ steps.build-new-readme.outputs.updated-text }}
run: echo "$README_TEXT" > README.md

- name: Commit changes
uses: EndBug/add-and-commit@v9
Expand Down
17 changes: 17 additions & 0 deletions markdown-templates/readme/exercise-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# {{ title }}

<img src="https://octodex.github.com/images/Professortocat_v2.png" align="right" height="200px" />

Hey **{{ login }}**!

Mona here. I'm done preparing your exercise. Hope you enjoy! 💚

Remember, it's self-paced so feel fee to take a break! ☕️

[![](https://img.shields.io/badge/Go%20to%20Exercise-%E2%86%92-1f883d?style=for-the-badge&logo=github&labelColor=197935)]({{{ issue_url }}})

---

Get help: [Post in our discussion board](https://github.com/orgs/skills/discussions/categories/) &bull; [Review the GitHub status page](https://www.githubstatus.com/)

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