File tree Expand file tree Collapse file tree 2 files changed +18
-29
lines changed
markdown-templates/readme Expand file tree Collapse file tree 2 files changed +18
-29
lines changed Original file line number Diff line number Diff line change 43
43
path : exercise-toolkit
44
44
ref : ${{ env.EXERCISE_TOOLKIT_REF }}
45
45
46
- - name : Encode socials text
47
- id : encode-socials-text
48
- uses : actions/github-script@v7
49
- env :
50
- EXERCISE_TITLE : ${{ inputs.exercise-title }}
51
- with :
52
- script : |
53
- const repoUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}`;
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}
61
-
62
- ${repoUrl}
63
-
64
- #GitHubSkills #OpenSource #GitHubLearn
65
- `;
66
-
67
- const encodedText = encodeURIComponent(socialsText);
68
- core.setOutput('encoded-text', encodedText);
69
-
70
46
- name : Build congratulations message from template
71
47
id : build-new-readme
72
48
uses : skills/action-text-variables@v3
75
51
template-vars : |
76
52
login: ${{ github.actor }}
77
53
issue_url: ${{ inputs.issue-url }}
78
- encoded_socials_text: ${{ steps.encode-socials-text.outputs.encoded-text }}
54
+ exercise_title: ${{ inputs.exercise-title }}
55
+ repository_url: https://github.com/${{ github.repository }}
79
56
80
57
- name : Overwrite README
81
58
env :
Original file line number Diff line number Diff line change
1
+ {% set socials_text -%}
2
+ {%- if exercise_title -%}
3
+ I just completed the "{{ exercise_title }}" GitHub Skills hands-on exercise! 🎉
4
+ {%- else -%}
5
+ I just completed a GitHub Skills hands-on exercise! 🎉
6
+ {%- endif %}
7
+
8
+ {{ repository_url }}
9
+
10
+ #GitHubSkills #OpenSource #GitHubLearn
11
+ {%- endset -%}
1
12
2
13
<div align =" center " >
3
14
11
22
12
23
** Show off your new skills and inspire others!**
13
24
14
- <a href =" https://twitter.com/intent/tweet?text={{ encoded_socials_text }} " target =" _blank " rel =" noopener noreferrer " >
25
+ <a href =" https://twitter.com/intent/tweet?text={{ socials_text | urlencode }} " target =" _blank " rel =" noopener noreferrer " >
15
26
<img src =" https://img.shields.io/badge/Share%20on%20X-1da1f2?style=for-the-badge&logo=x&logoColor=white " alt =" Share on X " />
16
27
</a >
17
- <a href =" https://bsky.app/intent/compose?text={{ encoded_socials_text }} " target =" _blank " rel =" noopener noreferrer " >
28
+ <a href =" https://bsky.app/intent/compose?text={{ socials_text | urlencode }} " target =" _blank " rel =" noopener noreferrer " >
18
29
<img src =" https://img.shields.io/badge/Share%20on%20Bluesky-0085ff?style=for-the-badge&logo=bluesky&logoColor=white " alt =" Share on Bluesky " />
19
30
</a >
20
- <a href =" https://www.linkedin.com/feed/?shareActive=true&text={{ encoded_socials_text }} " target =" _blank " rel =" noopener noreferrer " >
31
+ <a href =" https://www.linkedin.com/feed/?shareActive=true&text={{ socials_text | urlencode }} " target =" _blank " rel =" noopener noreferrer " >
21
32
<img src =" https://img.shields.io/badge/Share%20on%20LinkedIn-0077b5?style=for-the-badge&logo=linkedin&logoColor=white " alt =" Share on LinkedIn " />
22
33
</a >
23
34
24
35
### 🎯 What's Next?
36
+
25
37
** Keep the momentum going!**
26
38
27
- [ ![ ] ( https://img.shields.io/badge/Return%20to%20Exercise-%E2%86%92-1f883d?style=for-the-badge&logo=github&labelColor=197935 )] ({{{ issue_url } }})
39
+ [ ![ ] ( https://img.shields.io/badge/Return%20to%20Exercise-%E2%86%92-1f883d?style=for-the-badge&logo=github&labelColor=197935 )] ({{ issue_url }})
28
40
[ ![ GitHub Skills] ( https://img.shields.io/badge/Explore%20GitHub%20Skills-000000?style=for-the-badge&logo=github&logoColor=white )] ( https://learn.github.com/skills ) )
29
41
30
42
* There's no better way to learn than building things!* 🚀
You can’t perform that action at this time.
0 commit comments