[WTH Core] Add Codespace configuration option to Create New Hack action#1200
Open
jrzyshr wants to merge 46 commits into
Open
[WTH Core] Add Codespace configuration option to Create New Hack action#1200jrzyshr wants to merge 46 commits into
jrzyshr wants to merge 46 commits into
Conversation
…archived "002-IntroToAI" hack
added link to 069 to the homepage
[Hack Update] 069-RealTimeAnalytics - add listing to WTH homepage
Testing md_in_html extension for pyseplling
This reverts commit a2c9fbc.
When authors invoke the Create New Hack workflow, they can now check an 'Include a GitHub Codespace configuration?' option. When enabled: - Creates .devcontainer/devcontainer.json in Student/Resources with the hack name updated (workspace lines remain commented for local use) - Creates .devcontainer/xxx-HackName/devcontainer.json at the repo root with workspaceFolder and workspaceMount uncommented and populated The workflow conditionally stages the root .devcontainer folder only when the codespace option is selected. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensures the Resources folder remains visible on GitHub even when the .devcontainer subfolder is present, so authors know where to place files. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The template now has full instructions for authors manually adding Codespace support to existing hacks (wrapped in TEMPLATE_INSTRUCTIONS markers). When the Create New Hack action copies the template, it strips these markers/instructions and inserts a brief customization comment with a link to the devcontainer reference docs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds an optional Codespaces/devcontainer scaffolding path to the “Create new hack” workflow so authors can generate the required devcontainer configuration files automatically (instead of manually copying/updating the template).
Changes:
- Adds a new
includeCodespaceboolean input to the workflow dispatch form and passes a new-sflag to the generator script. - Extends
create-wth-template.shwith-shandling to generate devcontainer config into both required locations. - Updates
000-HowToHack/devcontainerTEMPLATE.jsonwith richer author instructions and instruction markers that the script strips during generation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
000-HowToHack/devcontainerTEMPLATE.json |
Adds instruction markers and expanded guidance for creating devcontainer/Codespaces configuration from the template. |
.github/workflows/create-wth-template.sh |
Introduces -s flag and generation logic to scaffold devcontainer.json files in both required locations. |
.github/workflows/create-new-hack.yml |
Adds a workflow-dispatch checkbox to enable Codespaces scaffolding and conditionally stages generated artifacts. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+69
to
+70
| # Prepare the brief comment header for Action-created copies | ||
| local -r briefComment="// Customize this devcontainer.json with features and extensions for your hackathon.\n// See: https://containers.dev/implementors/json_reference/\n" |
Comment on lines
+62
to
+64
| if $verbosityArg; then | ||
| echo "Creating Codespace configuration for $wthDirectoryName..." | ||
| fi |
Comment on lines
+15
to
+17
| includeCodespace: | ||
| description: Include a GitHub Codespace configuration? | ||
| type: boolean |
Comment on lines
42
to
+45
| git add * | ||
| if [ "${{ github.event.inputs.includeCodespace }}" = "true" ]; then | ||
| git add .devcontainer | ||
| fi |
Comment on lines
+5
to
+6
| // Instructions for hackathon authors adding Codespace support to an existing hack: | ||
| // 1. Copy this file to the following two locations: |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+69
to
+70
| # Prepare the brief comment header for Action-created copies | ||
| local -r briefComment="// Customize this devcontainer.json with features and extensions for your hackathon.\n// See: https://containers.dev/implementors/json_reference/\n" |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds an optional "Include a GitHub Codespace configuration?" checkbox to the Create New Hack GitHub Action workflow. When an author enables this option, the action automatically scaffolds the devcontainer configuration in both required locations.
Changes
Workflow (
create-new-hack.yml)includeCodespaceboolean input to the workflow dispatch form-sflag to the shell script when enabled.devcontainerfolderShell script (
create-wth-template.sh)-sflag andCreateCodespaceConfig()function/Student/Resources/.devcontainer/devcontainer.json— workspace lines remain commented (for local devcontainer use)/.devcontainer/xxx-HackName/devcontainer.json— workspace lines uncommented and populated (for GitHub Codespaces)Template (
000-HowToHack/devcontainerTEMPLATE.json)TEMPLATE_INSTRUCTIONS_START/ENDmarkers so the action can strip them when creating copiesBehavior