How to use Open in Codespaces in GitHub Classroom #54309
Replies: 3 comments 1 reply
-
Hi Brian, Yes, you can use variables in the URL to dynamically generate the link to create a Codespace for each student. Here's an example of how you can do this: In your README, include a link to create a Codespace with the following format: This URL uses the When a student clones the template Assignment repository, they will also clone the README file with the dynamic Codespace link. When they click the link, it will automatically generate a Codespace using their copy of the repository. Note: If you want to make sure that the link works for all students, regardless of whether they are using a personal or organizational account to access GitHub Classroom, you can use the |
Beta Was this translation helpful? Give feedback.
-
Dear Hrishikesh,
This is just what I was looking for. I could not find this feature documented anywhere. Thanks a lot.
I will try it out now and see how I go.
All the very best,
Brian
|
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I want to put Open in Codespaces in the README of a GitHub Classroom assignment. I want the Codespace to be created from the students copy of the template Assignment. I have looked at the link below and this method requires me to specify the OWNER and REPO-NAME in the URL. However this will change for each student, so I can't hardcode this information into the URL. Is there a way to do some form of variable substitution in this link?
https://codespaces.new/OWNER/REPO-NAME
https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/setting-up-your-repository/facilitating-quick-creation-and-resumption-of-codespaces
Beta Was this translation helpful? Give feedback.
All reactions