-
Notifications
You must be signed in to change notification settings - Fork 20
docs: update documentation to mention moving to Nunjucks templating and include usage with GrantBirki/comment #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,8 @@ | |
| - [Starting an exercise](#starting-an-exercise) | ||
| - [Finding an exercise](#finding-an-exercise) | ||
| - [📋 Markdown Templates](#-markdown-templates) | ||
| - [Using with GrantBirki/comment for issue comments](#using-with-grantbirkicomment-for-issue-comments) | ||
| - [Using with action-text-variables for file updates](#using-with-action-text-variables-for-file-updates) | ||
| - [Notable Resources](#notable-resources) | ||
|
|
||
| ## Purpose | ||
|
|
@@ -70,7 +72,32 @@ steps: | |
| cat exercise-toolkit/markdown-templates/step-feedback/checking-work.md | ||
| ``` | ||
|
|
||
| Markdown templates are often used together with [skills/action-text-variables](https://github.com/skills/action-text-variables) GitHub Action | ||
| #### Using with GrantBirki/comment for issue comments | ||
|
|
||
| Templates are often used with [GrantBirki/comment](https://github.com/GrantBirki/comment) to create dynamic comments on issues or pull requests: | ||
|
|
||
| ```yaml | ||
| steps: | ||
| - name: Get markdown templates | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: skills/exercise-toolkit | ||
| path: exercise-toolkit | ||
| ref: <git-tag> | ||
|
|
||
| - name: Create comment - step finished | ||
| uses: GrantBirki/[email protected] | ||
| with: | ||
| file: exercise-toolkit/markdown-templates/step-feedback/step-finished-prepare-next-step.md | ||
| issue-number: ${{ env.ISSUE_NUMBER }} | ||
| repository: ${{ env.ISSUE_REPOSITORY }} | ||
| vars: | | ||
| next_step_number: 2 | ||
| ``` | ||
|
|
||
| #### Using with action-text-variables for file updates | ||
|
|
||
| Markdown templates can also be used with [skills/action-text-variables](https://github.com/skills/action-text-variables) to generate dynamic content for any purpose, e.g updating a file. | ||
|
|
||
| ```yaml | ||
| steps: | ||
|
|
@@ -81,18 +108,20 @@ steps: | |
| path: exercise-toolkit | ||
| ref: <git-tag> | ||
|
|
||
| - name: Build message - congratulations | ||
| id: build-message-congratulations | ||
| uses: skills/action-text-variables@v2 | ||
| - name: Build README from template | ||
| id: build-readme | ||
| uses: skills/action-text-variables@v3 | ||
| with: | ||
| template-file: exercise-toolkit/markdown-templates/readme/congratulations.md | ||
| 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: Echo updated text | ||
| run: echo "$UPDATED_TEXT" | ||
| - name: Update README file | ||
| run: echo "$README_CONTENT" > README.md | ||
| env: | ||
| UPDATED_TEXT: ${{ steps.build-message-congratulations.outputs.updated-text }} | ||
| README_CONTENT: ${{ steps.build-readme.outputs.updated-text }} | ||
| ``` | ||
|
|
||
| ## Notable Resources | ||
|
|
@@ -101,4 +130,5 @@ These GitHub Actions are particularly useful when creating GitHub Skills Exercis | |
|
|
||
| - **[skills/action-text-variables](https://github.com/skills/action-text-variables)**: Replace variables in template files with dynamic content | ||
| - **[skills/action-keyphrase-checker](https://github.com/skills/action-keyphrase-checker)**: Verify if specific keyphrases exist in files or content | ||
| - **[GrantBirki/comment](https://github.com/GrantBirki/comment)**: Create comments on GitHub issues or pull requests with support for Nunjucks templating | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.