Skip to content

Commit 769391b

Browse files
feat: include bug report url at the beginning of each exercise (#96)
1 parent b9ec545 commit 769391b

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

.github/workflows/start-exercise.yml

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ on:
44
workflow_call:
55
inputs:
66
exercise-title:
7-
description: 'Title of the exercise'
7+
description: "Title of the exercise"
88
required: true
99
type: string
1010
issue-title-prefix:
11-
description: 'Prefix for the exercise title in the issue'
11+
description: "Prefix for the exercise title in the issue"
1212
required: false
1313
type: string
14-
default: 'Exercise: '
14+
default: "Exercise: "
1515
intro-message:
16-
description: 'Introduction message for the exercise'
16+
description: "Introduction message for the exercise"
1717
required: true
1818
type: string
1919
outputs:
2020
issue-url:
21-
description: 'URL of the created issue'
21+
description: "URL of the created issue"
2222
value: ${{ jobs.create_exercise.outputs.issue-url }}
2323
issue-number:
24-
description: 'Number of the created issue'
24+
description: "Number of the created issue"
2525
value: ${{ jobs.create_exercise.outputs.issue-number }}
2626

2727
permissions:
@@ -30,7 +30,7 @@ permissions:
3030
issues: write # Create issue
3131

3232
env:
33-
EXERCISE_TOOLKIT_REF: 82efbc3de835a2b67d315833bb2f876ae9b4e07a
33+
EXERCISE_TOOLKIT_REF: 0b0154a6a164ddb582dcad16aa928b507af0b69f
3434

3535
jobs:
3636
disable_workflows:
@@ -52,7 +52,6 @@ jobs:
5252
env:
5353
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5454

55-
5655
create_exercise:
5756
name: Create exercise issue
5857
runs-on: ubuntu-latest
@@ -69,6 +68,24 @@ jobs:
6968
path: exercise-toolkit
7069
ref: ${{ env.EXERCISE_TOOLKIT_REF }}
7170

71+
- name: Get template repository
72+
id: get-template-repo
73+
uses: actions/github-script@v8
74+
with:
75+
script: |
76+
const { data: repo } = await github.rest.repos.get({
77+
owner: context.repo.owner,
78+
repo: context.repo.repo
79+
});
80+
81+
if (repo.template_repository) {
82+
console.log(`Template repository found: ${repo.template_repository.full_name}`);
83+
const issueReportUrl = `https://github.com/${repo.template_repository.full_name}/issues`;
84+
core.setOutput('ISSUE_REPORT_URL', issueReportUrl);
85+
} else {
86+
console.log('No template repository found for this repository');
87+
}
88+
7289
- name: Build welcome message from template
7390
id: build-issue-description
7491
uses: skills/action-text-variables@v3
@@ -78,6 +95,7 @@ jobs:
7895
title: ${{ inputs.exercise-title }}
7996
login: ${{ github.actor }}
8097
intro_message: ${{ inputs.intro-message }}
98+
bug_report_url: ${{ steps.get-template-repo.outputs.ISSUE_REPORT_URL || '' }}
8199
82100
- name: Create issue - add welcome message
83101
id: create-issue

markdown-templates/step-feedback/welcome.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ As you complete each step, I’ll leave updates in the comments:
1919
Let’s get started - good luck and have fun!
2020

2121
<sub>— Mona</sub>
22+
23+
{%- if bug_report_url %}
24+
> <sub> If you encounter any issues along the way please report them [here]({{ bug_report_url}}).</sub>
25+
{%- endif %}

0 commit comments

Comments
 (0)