File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 7
7
description : " The URL of the issue to update and close"
8
8
required : true
9
9
type : string
10
+ exercise-title :
11
+ description : " The title of the exercise"
12
+ required : false
13
+ type : string
10
14
update-readme-with-congratulations :
11
15
description : " Whether to update the README with a congratulations message"
12
16
required : false
@@ -42,10 +46,18 @@ jobs:
42
46
- name : Encode socials text
43
47
id : encode-socials-text
44
48
uses : actions/github-script@v7
49
+ env :
50
+ EXERCISE_TITLE : ${{ inputs.exercise-title }}
45
51
with :
46
52
script : |
47
53
const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}`;
48
- const socialsText = `I just completed a GitHub Skills exercise! 🎉
54
+ const exerciseTitle = process.env.EXERCISE_TITLE;
55
+
56
+ const firstLine = exerciseTitle && exerciseTitle.trim() !== ''
57
+ ? `I just completed the "${exerciseTitle}" GitHub Skills hands-on exercise! 🎉`
58
+ : `I just completed a GitHub Skills hands-on exercise! 🎉`;
59
+
60
+ const socialsText = `${firstLine}
49
61
50
62
${repoUrl}
51
63
97
109
template-vars : |
98
110
login: ${{ github.actor }}
99
111
repo_full_name: ${{ github.repository }}
100
-
101
112
- name : Create comment - exercise finished
102
113
run : |
103
114
gh issue comment "${{ inputs.issue-url }}" \
You can’t perform that action at this time.
0 commit comments