Init github_code import PR
#4
by Gugu8 - opened
This view is limited to 50 files because it contains too many changes. See the raw diff here.
- .gitattributes +4 -0
- github_code/README.md +2 -0
- github_code/codecrafters-io__build-your-own-x/.gitattributes +2 -0
- github_code/codecrafters-io__build-your-own-x/ISSUE_TEMPLATE.md +39 -0
- github_code/codecrafters-io__build-your-own-x/README.md +505 -0
- github_code/codecrafters-io__build-your-own-x/codecrafters-banner.png +3 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/codespace-env.sh +23 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/devcontainer.json +51 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/docker-compose.yml +33 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/on-create.sh +8 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/post-create.sh +30 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/post-start.sh +43 -0
- github_code/freeCodeCamp__freeCodeCamp/.devcontainer/welcome.sh +17 -0
- github_code/freeCodeCamp__freeCodeCamp/.dockerignore +11 -0
- github_code/freeCodeCamp__freeCodeCamp/.editorconfig +16 -0
- github_code/freeCodeCamp__freeCodeCamp/.gitattributes +15 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/.well-known/funding-manifest-urls +1 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/CODEOWNERS +36 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/FUNDING.yml +3 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/01--issues-with-coding-challenges.yml +61 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/02--issues-with-software-on-platforms.yml +60 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/03--issues-with-content-on-articles-and-docs.yml +41 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/04--feature-request-for-freecodecamp-org-s-platforms.yml +29 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/config.yml +11 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/PULL_REQUEST_TEMPLATE.md +14 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/actions/setup-turbo-cache/action.yml +75 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/copilot-instructions.md +186 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/instructions/testing.instructions.md +98 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/labeler.yml +26 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/check-allow-list.js +24 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/check-pr-template.js +39 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/fix-pr-title.js +79 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/report-results.js +83 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/crowdin-download.client-ui.yml +342 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/crowdin-upload.client-ui.yml +55 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/crowdin-upload.curriculum.yml +80 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/curriculum-i18n-submodule.yml +78 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/deploy-api.yml +353 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/deploy-client.yml +393 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/devcontainer-ci.yml +112 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/docker-docr-cleanup.yml +35 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/docker-docr.yml +125 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/docker-ghcr.yml +50 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/e2e-playwright.yml +98 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-autoclose.yml +74 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-labeler.yaml +24 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-lock-closed-prs.yml +24 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-no-i18n-via-prs.yml +34 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-pr-guidelines.yml +209 -0
- github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-spam.yml +27 -0
.gitattributes
CHANGED
|
@@ -59,3 +59,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
code_syntax_dataset_1GB.csv filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
*.mp4 filter=lfs diff=lfs merge=lfs -text
|
| 60 |
*.webm filter=lfs diff=lfs merge=lfs -text
|
| 61 |
code_syntax_dataset_1GB.csv filter=lfs diff=lfs merge=lfs -text
|
| 62 |
+
github_code/freeCodeCamp__freeCodeCamp/client/static/fonts/noto-sans-japanese/NotoSansJP-Black.woff filter=lfs diff=lfs merge=lfs -text
|
| 63 |
+
github_code/freeCodeCamp__freeCodeCamp/client/static/fonts/noto-sans-japanese/NotoSansJP-Bold.woff filter=lfs diff=lfs merge=lfs -text
|
| 64 |
+
github_code/freeCodeCamp__freeCodeCamp/client/static/fonts/noto-sans-japanese/NotoSansJP-Light.woff filter=lfs diff=lfs merge=lfs -text
|
| 65 |
+
github_code/freeCodeCamp__freeCodeCamp/client/static/fonts/noto-sans-japanese/NotoSansJP-Regular.woff filter=lfs diff=lfs merge=lfs -text
|
github_code/README.md
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GitHub Code Import
|
| 2 |
+
This PR will contain 500 top-starred GitHub repos extracted from zip.
|
github_code/codecrafters-io__build-your-own-x/.gitattributes
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.md linguist-detectable=true
|
| 2 |
+
*.md linguist-documentation=false
|
github_code/codecrafters-io__build-your-own-x/ISSUE_TEMPLATE.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!--
|
| 2 |
+
Thanks for your contribution! If you're submitting a tutorial, please ensure it includes a guided path for learners, either through a step-by-step article or by breaking down code into digestible parts that are easy to follow. Please submit only programming tutorials that build something interesting from scratch; no frameworks, libraries, guides for frameworks/libraries or tutorials that glue just other libraries together.
|
| 3 |
+
-->
|
| 4 |
+
|
| 5 |
+
### Main programming language
|
| 6 |
+
<!-- max. 1 -->
|
| 7 |
+
|
| 8 |
+
### Tutorial title
|
| 9 |
+
<!-- the original title from the article, repository, ... -->
|
| 10 |
+
|
| 11 |
+
### Tutorial URL
|
| 12 |
+
|
| 13 |
+
### Category
|
| 14 |
+
* [ ] 3D Renderer
|
| 15 |
+
* [ ] Augmented Reality
|
| 16 |
+
* [ ] BitTorrent Client
|
| 17 |
+
* [ ] Blockchain / Cryptocurrency
|
| 18 |
+
* [ ] Bot
|
| 19 |
+
* [ ] Command-Line Tool
|
| 20 |
+
* [ ] Database
|
| 21 |
+
* [ ] Docker
|
| 22 |
+
* [ ] Emulator / Virtual Machine
|
| 23 |
+
* [ ] Front-end Framework / Library
|
| 24 |
+
* [ ] Game
|
| 25 |
+
* [ ] Git
|
| 26 |
+
* [ ] Network Stack
|
| 27 |
+
* [ ] Neural Network
|
| 28 |
+
* [ ] Operating System
|
| 29 |
+
* [ ] Physics Engine
|
| 30 |
+
* [ ] Programming Language
|
| 31 |
+
* [ ] Regex Engine
|
| 32 |
+
* [ ] Search Engine
|
| 33 |
+
* [ ] Shell
|
| 34 |
+
* [ ] Template Engine
|
| 35 |
+
* [ ] Visual Recognition System
|
| 36 |
+
* [ ] Voxel Engine
|
| 37 |
+
* [ ] Web Search Engine
|
| 38 |
+
* [ ] Web Server
|
| 39 |
+
* [ ] Uncategorized
|
github_code/codecrafters-io__build-your-own-x/README.md
ADDED
|
@@ -0,0 +1,505 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[](https://codecrafters.io/github-banner)
|
| 2 |
+
|
| 3 |
+
## Build your own <insert-technology-here>
|
| 4 |
+
|
| 5 |
+
This repository is a compilation of well-written, step-by-step guides for re-creating our favorite technologies from scratch.
|
| 6 |
+
|
| 7 |
+
> *What I cannot create, I do not understand — Richard Feynman.*
|
| 8 |
+
|
| 9 |
+
It's a great way to learn.
|
| 10 |
+
|
| 11 |
+
* [3D Renderer](#build-your-own-3d-renderer)
|
| 12 |
+
* [AI Model](#build-your-own-ai-model)
|
| 13 |
+
* [Augmented Reality](#build-your-own-augmented-reality)
|
| 14 |
+
* [BitTorrent Client](#build-your-own-bittorrent-client)
|
| 15 |
+
* [Blockchain / Cryptocurrency](#build-your-own-blockchain--cryptocurrency)
|
| 16 |
+
* [Bot](#build-your-own-bot)
|
| 17 |
+
* [Command-Line Tool](#build-your-own-command-line-tool)
|
| 18 |
+
* [Database](#build-your-own-database)
|
| 19 |
+
* [Docker](#build-your-own-docker)
|
| 20 |
+
* [Emulator / Virtual Machine](#build-your-own-emulator--virtual-machine)
|
| 21 |
+
* [Front-end Framework / Library](#build-your-own-front-end-framework--library)
|
| 22 |
+
* [Game](#build-your-own-game)
|
| 23 |
+
* [Git](#build-your-own-git)
|
| 24 |
+
* [Memory Allocator](#build-your-own-memory-allocator)
|
| 25 |
+
* [Network Stack](#build-your-own-network-stack)
|
| 26 |
+
* [Neural Network](#build-your-own-neural-network)
|
| 27 |
+
* [Operating System](#build-your-own-operating-system)
|
| 28 |
+
* [Physics Engine](#build-your-own-physics-engine)
|
| 29 |
+
* [Processor](#build-your-own-processor)
|
| 30 |
+
* [Programming Language](#build-your-own-programming-language)
|
| 31 |
+
* [Regex Engine](#build-your-own-regex-engine)
|
| 32 |
+
* [Search Engine](#build-your-own-search-engine)
|
| 33 |
+
* [Shell](#build-your-own-shell)
|
| 34 |
+
* [Template Engine](#build-your-own-template-engine)
|
| 35 |
+
* [Text Editor](#build-your-own-text-editor)
|
| 36 |
+
* [Visual Recognition System](#build-your-own-visual-recognition-system)
|
| 37 |
+
* [Voxel Engine](#build-your-own-voxel-engine)
|
| 38 |
+
* [Web Browser](#build-your-own-web-browser)
|
| 39 |
+
* [Web Server](#build-your-own-web-server)
|
| 40 |
+
* [Uncategorized](#uncategorized)
|
| 41 |
+
|
| 42 |
+
## Tutorials
|
| 43 |
+
|
| 44 |
+
#### Build your own `Distributed Systems`
|
| 45 |
+
* [**Java**: _Building Your Own Kafka-like System From Scratch: A Step-by-Step Guide_](https://github.com/buildthingsuseful/build-your-own-kafka)
|
| 46 |
+
|
| 47 |
+
#### Build your own `3D Renderer`
|
| 48 |
+
|
| 49 |
+
* [**C++**: _Introduction to Ray Tracing: a Simple Method for Creating 3D Images_](https://www.scratchapixel.com/lessons/3d-basic-rendering/introduction-to-ray-tracing/how-does-it-work)
|
| 50 |
+
* [**C++**: _How OpenGL works: software rendering in 500 lines of code_](https://github.com/ssloy/tinyrenderer/wiki)
|
| 51 |
+
* [**C++**: _Raycasting engine of Wolfenstein 3D_](http://lodev.org/cgtutor/raycasting.html)
|
| 52 |
+
* [**C++**: _Physically Based Rendering:From Theory To Implementation_](http://www.pbr-book.org/)
|
| 53 |
+
* [**C++**: _Ray Tracing in One Weekend_](https://raytracing.github.io/books/RayTracingInOneWeekend.html)
|
| 54 |
+
* [**C++**: _Rasterization: a Practical Implementation_](https://www.scratchapixel.com/lessons/3d-basic-rendering/rasterization-practical-implementation/overview-rasterization-algorithm)
|
| 55 |
+
* [**C# / TypeScript / JavaScript**: _Learning how to write a 3D soft engine from scratch in C#, TypeScript or JavaScript_](https://www.davrous.com/2013/06/13/tutorial-series-learning-how-to-write-a-3d-soft-engine-from-scratch-in-c-typescript-or-javascript/)
|
| 56 |
+
* [**Java / JavaScript**: _Build your own 3D renderer_](https://avik-das.github.io/build-your-own-raytracer/)
|
| 57 |
+
* [**Java**: _How to create your own simple 3D render engine in pure Java_](http://blog.rogach.org/2015/08/how-to-create-your-own-simple-3d-render.html)
|
| 58 |
+
* [**JavaScript / Pseudocode**: _Computer Graphics from scratch_](http://www.gabrielgambetta.com/computer-graphics-from-scratch/introduction.html)
|
| 59 |
+
* [**Python**: _A 3D Modeller_](http://aosabook.org/en/500L/a-3d-modeller.html)
|
| 60 |
+
|
| 61 |
+
#### Build your own `AI Model`
|
| 62 |
+
* [**Python**: _A Large Language Model (LLM)_](https://github.com/rasbt/LLMs-from-scratch)
|
| 63 |
+
* [**Python**: _Diffusion Models for Image Generation_](https://huggingface.co/learn/diffusion-course/en/unit1/3)
|
| 64 |
+
* [**Python**: _RAG for Document Search_](https://github.com/langchain-ai/rag-from-scratch)
|
| 65 |
+
|
| 66 |
+
#### Build your own `Augmented Reality`
|
| 67 |
+
|
| 68 |
+
* [**C#**: _How To: Augmented Reality App Tutorial for Beginners with Vuforia and Unity 3D_](https://www.youtube.com/watch?v=uXNjNcqW4kY) [video]
|
| 69 |
+
* [**C#**: _How To Unity ARCore_](https://www.youtube.com/playlist?list=PLKIKuXdn4ZMjuUAtdQfK1vwTZPQn_rgSv) [video]
|
| 70 |
+
* [**C#**: _AR Portal Tutorial with Unity_](https://www.youtube.com/playlist?list=PLPCqNOwwN794Gz5fzUSi1p4OqLU0HTmvn) [video]
|
| 71 |
+
* [**C#**: _How to create a Dragon in Augmented Reality in Unity ARCore_](https://www.youtube.com/watch?v=qTSDPkPyPqs) [video]
|
| 72 |
+
* [**C#**: _How to Augmented Reality AR Tutorial: ARKit Portal to the Upside Down_](https://www.youtube.com/watch?v=Z5AmqMuNi08) [video]
|
| 73 |
+
* [**Python**: _Augmented Reality with Python and OpenCV_](https://bitesofcode.wordpress.com/2017/09/12/augmented-reality-with-python-and-opencv-part-1/)
|
| 74 |
+
|
| 75 |
+
#### Build your own `BitTorrent Client`
|
| 76 |
+
|
| 77 |
+
* [**C#**: _Building a BitTorrent client from scratch in C#_](https://www.seanjoflynn.com/research/bittorrent.html)
|
| 78 |
+
* [**Go**: _Building a BitTorrent client from the ground up in Go_](https://blog.jse.li/posts/torrent/)
|
| 79 |
+
* [**Nim**: _Writing a Bencode Parser_](https://xmonader.github.io/nimdays/day02_bencode.html)
|
| 80 |
+
* [**Node.js**: _Write your own bittorrent client_](https://allenkim67.github.io/programming/2016/05/04/how-to-make-your-own-bittorrent-client.html)
|
| 81 |
+
* [**Python**: _A BitTorrent client in Python 3.5_](http://markuseliasson.se/article/bittorrent-in-python/)
|
| 82 |
+
|
| 83 |
+
#### Build your own `Blockchain / Cryptocurrency`
|
| 84 |
+
|
| 85 |
+
* [**ATS**: _Functional Blockchain_](https://beta.observablehq.com/@galletti94/functional-blockchain)
|
| 86 |
+
* [**Crystal**: _Write your own blockchain and PoW algorithm using Crystal_](https://medium.com/@bradford_hamilton/write-your-own-blockchain-and-pow-algorithm-using-crystal-d53d5d9d0c52)
|
| 87 |
+
* [**Go**: _Building Blockchain in Go_](https://jeiwan.net/posts/building-blockchain-in-go-part-1/)
|
| 88 |
+
* [**Go**: _Code your own blockchain in less than 200 lines of Go_](https://medium.com/@mycoralhealth/code-your-own-blockchain-in-less-than-200-lines-of-go-e296282bcffc)
|
| 89 |
+
* [**Java**: _Creating Your First Blockchain with Java_](https://medium.com/programmers-blockchain/create-simple-blockchain-java-tutorial-from-scratch-6eeed3cb03fa)
|
| 90 |
+
* [**JavaScript**: _A cryptocurrency implementation in less than 1500 lines of code_](https://github.com/conradoqg/naivecoin)
|
| 91 |
+
* [**JavaScript**: _Build your own Blockchain in JavaScript_](https://github.com/nambrot/blockchain-in-js)
|
| 92 |
+
* [**JavaScript**: _Learn & Build a JavaScript Blockchain_](https://medium.com/digital-alchemy-holdings/learn-build-a-javascript-blockchain-part-1-ca61c285821e)
|
| 93 |
+
* [**JavaScript**: _Creating a blockchain with JavaScript_](https://github.com/SavjeeTutorials/SavjeeCoin)
|
| 94 |
+
* [**JavaScript**: _How To Launch Your Own Production-Ready Cryptocurrency_](https://hackernoon.com/how-to-launch-your-own-production-ready-cryptocurrency-ab97cb773371)
|
| 95 |
+
* [**JavaScript**: _Writing a Blockchain in Node.js_](https://www.smashingmagazine.com/2020/02/cryptocurrency-blockchain-node-js/)
|
| 96 |
+
* [**Kotlin**: _Let’s implement a cryptocurrency in Kotlin_](https://medium.com/@vasilyf/lets-implement-a-cryptocurrency-in-kotlin-part-1-blockchain-8704069f8580)
|
| 97 |
+
* [**Python**: _Learn Blockchains by Building One_](https://hackernoon.com/learn-blockchains-by-building-one-117428612f46)
|
| 98 |
+
* [**Python**: _Build your own blockchain: a Python tutorial_](http://ecomunsing.com/build-your-own-blockchain)
|
| 99 |
+
* [**Python**: _A Practical Introduction to Blockchain with Python_](http://adilmoujahid.com/posts/2018/03/intro-blockchain-bitcoin-python/)
|
| 100 |
+
* [**Python**: _Let’s Build the Tiniest Blockchain_](https://medium.com/crypto-currently/lets-build-the-tiniest-blockchain-e70965a248b)
|
| 101 |
+
* [**Ruby**: _Programming Blockchains Step-by-Step (Manuscripts Book Edition)_](https://github.com/yukimotopress/programming-blockchains-step-by-step)
|
| 102 |
+
* [**Scala**: _How to build a simple actor-based blockchain_](https://medium.freecodecamp.org/how-to-build-a-simple-actor-based-blockchain-aac1e996c177)
|
| 103 |
+
* [**TypeScript**: _Naivecoin: a tutorial for building a cryptocurrency_](https://lhartikk.github.io/)
|
| 104 |
+
* [**TypeScript**: _NaivecoinStake: a tutorial for building a cryptocurrency with the Proof of Stake consensus_](https://naivecoinstake.learn.uno/)
|
| 105 |
+
* [**Rust**: _Building A Blockchain in Rust & Substrate_](https://hackernoon.com/building-a-blockchain-in-rust-and-substrate-a-step-by-step-guide-for-developers-kc223ybp)
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
#### Build your own `Bot`
|
| 109 |
+
|
| 110 |
+
* [**Haskell**: _Roll your own IRC bot_](https://wiki.haskell.org/Roll_your_own_IRC_bot)
|
| 111 |
+
* [**Node.js**: _Creating a Simple Facebook Messenger AI Bot with API.ai in Node.js_](https://tutorials.botsfloor.com/creating-a-simple-facebook-messenger-ai-bot-with-api-ai-in-node-js-50ae2fa5c80d)
|
| 112 |
+
* [**Node.js**: _How to make a responsive telegram bot_](https://www.sohamkamani.com/blog/2016/09/21/making-a-telegram-bot/)
|
| 113 |
+
* [**Node.js**: _Create a Discord bot_](https://discordjs.guide/)
|
| 114 |
+
* [**Node.js**: _gifbot - Building a GitHub App_](https://blog.scottlogic.com/2017/05/22/gifbot-github-integration.html)
|
| 115 |
+
* [**Node.js**: _Building A Simple AI Chatbot With Web Speech API And Node.js_](https://www.smashingmagazine.com/2017/08/ai-chatbot-web-speech-api-node-js/)
|
| 116 |
+
* [**Python**: _How to Build Your First Slack Bot with Python_](https://www.fullstackpython.com/blog/build-first-slack-bot-python.html)
|
| 117 |
+
* [**Python**: _How to build a Slack Bot with Python using Slack Events API & Django under 20 minute_](https://medium.com/freehunch/how-to-build-a-slack-bot-with-python-using-slack-events-api-django-under-20-minute-code-included-269c3a9bf64e)
|
| 118 |
+
* [**Python**: _Build a Reddit Bot_](https://pythonforengineers.com/blog/build-a-reddit-bot-part-1/)
|
| 119 |
+
* [**Python**: _How To Make A Reddit Bot_](https://www.youtube.com/watch?v=krTUf7BpTc0) [video]
|
| 120 |
+
* [**Python**: _How To Create a Telegram Bot Using Python_](https://www.freecodecamp.org/news/how-to-create-a-telegram-bot-using-python/)
|
| 121 |
+
* [**Python**: _Create a Twitter Bot in Python Using Tweepy_](https://medium.freecodecamp.org/creating-a-twitter-bot-in-python-with-tweepy-ac524157a607)
|
| 122 |
+
* [**Python**: _Creating Reddit Bot with Python & PRAW_](https://www.youtube.com/playlist?list=PLIFBTFgFpoJ9vmYYlfxRFV6U_XhG-4fpP) [video]
|
| 123 |
+
* [**R**: _Build A Cryptocurrency Trading Bot with R_](https://towardsdatascience.com/build-a-cryptocurrency-trading-bot-with-r-1445c429e1b1)
|
| 124 |
+
* [**Rust**: _A bot for Starcraft in Rust, C or any other language_](https://habr.com/en/post/436254/)
|
| 125 |
+
|
| 126 |
+
#### Build your own `Command-Line Tool`
|
| 127 |
+
|
| 128 |
+
* [**Go**: _Visualize your local git contributions with Go_](https://flaviocopes.com/go-git-contributions/)
|
| 129 |
+
* [**Go**: _Build a command line app with Go: lolcat_](https://flaviocopes.com/go-tutorial-lolcat/)
|
| 130 |
+
* [**Go**: _Building a cli command with Go: cowsay_](https://flaviocopes.com/go-tutorial-cowsay/)
|
| 131 |
+
* [**Go**: _Go CLI tutorial: fortune clone_](https://flaviocopes.com/go-tutorial-fortune/)
|
| 132 |
+
* [**Nim**: _Writing a stow alternative to manage dotfiles_](https://xmonader.github.io/nimdays/day06_nistow.html)
|
| 133 |
+
* [**Node.js**: _Create a CLI tool in Javascript_](https://citw.dev/tutorial/create-your-own-cli-tool)
|
| 134 |
+
* [**Rust**: _Command line apps in Rust_](https://rust-cli.github.io/book/index.html)
|
| 135 |
+
* [**Rust**: _Writing a Command Line Tool in Rust_](https://mattgathu.dev/2017/08/29/writing-cli-app-rust.html)
|
| 136 |
+
* [**Zig**: _Build Your Own CLI App in Zig from Scratch_](https://rebuild-x.github.io/docs/#/./zig/terminal/cli)
|
| 137 |
+
|
| 138 |
+
|
| 139 |
+
#### Build your own `Database`
|
| 140 |
+
|
| 141 |
+
* [**C**: _Let's Build a Simple Database_](https://cstack.github.io/db_tutorial/)
|
| 142 |
+
* [**C++**: _Build Your Own Redis from Scratch_](https://build-your-own.org/redis)
|
| 143 |
+
* [**C#**: _Build Your Own Database_](https://www.codeproject.com/Articles/1029838/Build-Your-Own-Database)
|
| 144 |
+
* [**Clojure**: _An Archaeology-Inspired Database_](http://aosabook.org/en/500L/an-archaeology-inspired-database.html)
|
| 145 |
+
* [**Crystal**: _Why you should build your own NoSQL Database_](https://medium.com/@marceloboeira/why-you-should-build-your-own-nosql-database-9bbba42039f5)
|
| 146 |
+
* [**Go**: _Build Your Own Database from Scratch: From B+Tree To SQL in 3000 Lines_](https://build-your-own.org/database/)
|
| 147 |
+
* [**Go**: _Code a database in 45 steps: a series of test-driven small coding puzzles_](https://trialofcode.org/database/)
|
| 148 |
+
* [**Go**: _Build Your Own Redis from Scratch_](https://www.build-redis-from-scratch.dev/)
|
| 149 |
+
* [**JavaScript**: _Dagoba: an in-memory graph database_](http://aosabook.org/en/500L/dagoba-an-in-memory-graph-database.html)
|
| 150 |
+
* [**Python**: _DBDB: Dog Bed Database_](http://aosabook.org/en/500L/dbdb-dog-bed-database.html)
|
| 151 |
+
* [**Python**: _Write your own miniature Redis with Python_](http://charlesleifer.com/blog/building-a-simple-redis-server-with-python/)
|
| 152 |
+
* [**Ruby**: _Build your own fast, persistent KV store in Ruby_](https://dineshgowda.com/posts/build-your-own-persistent-kv-store/)
|
| 153 |
+
* [**Rust**: _Build your own Redis client and server_](https://tokio.rs/tokio/tutorial/setup)
|
| 154 |
+
|
| 155 |
+
#### Build your own `Docker`
|
| 156 |
+
|
| 157 |
+
* [**C**: _Linux containers in 500 lines of code_](https://blog.lizzie.io/linux-containers-in-500-loc.html)
|
| 158 |
+
* [**Go**: _Build Your Own Container Using Less than 100 Lines of Go_](https://www.infoq.com/articles/build-a-container-golang)
|
| 159 |
+
* [**Go**: _Building a container from scratch in Go_](https://www.youtube.com/watch?v=8fi7uSYlOdc) [video]
|
| 160 |
+
* [**Python**: _A workshop on Linux containers: Rebuild Docker from Scratch_](https://github.com/Fewbytes/rubber-docker)
|
| 161 |
+
* [**Python**: _A proof-of-concept imitation of Docker, written in 100% Python_](https://github.com/tonybaloney/mocker)
|
| 162 |
+
* [**Shell**: _Docker implemented in around 100 lines of bash_](https://github.com/p8952/bocker)
|
| 163 |
+
|
| 164 |
+
#### Build your own `Emulator / Virtual Machine`
|
| 165 |
+
|
| 166 |
+
* [**C**: _Home-grown bytecode interpreters_](https://medium.com/bumble-tech/home-grown-bytecode-interpreters-51e12d59b25c)
|
| 167 |
+
* [**C**: _Virtual machine in C_](http://web.archive.org/web/20200121100942/https://blog.felixangell.com/virtual-machine-in-c/)
|
| 168 |
+
* [**C**: _Write your Own Virtual Machine_](https://justinmeiners.github.io/lc3-vm/)
|
| 169 |
+
* [**C**: _Writing a Game Boy emulator, Cinoop_](https://cturt.github.io/cinoop.html)
|
| 170 |
+
* [**C++**: _How to write an emulator (CHIP-8 interpreter)_](http://www.multigesture.net/articles/how-to-write-an-emulator-chip-8-interpreter/)
|
| 171 |
+
* [**C++**: _Emulation tutorial (CHIP-8 interpreter)_](http://www.codeslinger.co.uk/pages/projects/chip8.html)
|
| 172 |
+
* [**C++**: _Emulation tutorial (GameBoy emulator)_](http://www.codeslinger.co.uk/pages/projects/gameboy.html)
|
| 173 |
+
* [**C++**: _Emulation tutorial (Master System emulator)_](http://www.codeslinger.co.uk/pages/projects/mastersystem/memory.html)
|
| 174 |
+
* [**C++**: _NES Emulator From Scratch_](https://www.youtube.com/playlist?list=PLrOv9FMX8xJHqMvSGB_9G9nZZ_4IgteYf) [video]
|
| 175 |
+
* [**Common Lisp**: _CHIP-8 in Common Lisp_](http://stevelosh.com/blog/2016/12/chip8-cpu/)
|
| 176 |
+
* [**JavaScript**: _GameBoy Emulation in JavaScript_](http://imrannazar.com/GameBoy-Emulation-in-JavaScript)
|
| 177 |
+
* [**Python**: _Emulation Basics: Write your own Chip 8 Emulator/Interpreter_](http://omokute.blogspot.com.br/2012/06/emulation-basics-write-your-own-chip-8.html)
|
| 178 |
+
* [**Rust**: _0dmg: Learning Rust by building a partial Game Boy emulator_](https://jeremybanks.github.io/0dmg/)
|
| 179 |
+
|
| 180 |
+
#### Build your own `Front-end Framework / Library`
|
| 181 |
+
|
| 182 |
+
* [**JavaScript**: _WTF is JSX (Let's Build a JSX Renderer)_](https://jasonformat.com/wtf-is-jsx/)
|
| 183 |
+
* [**JavaScript**: _A DIY guide to build your own React_](https://github.com/hexacta/didact)
|
| 184 |
+
* [**JavaScript**: _Building React From Scratch_](https://www.youtube.com/watch?v=_MAD4Oly9yg) [video]
|
| 185 |
+
* [**JavaScript**: _Gooact: React in 160 lines of JavaScript_](https://medium.com/@sweetpalma/gooact-react-in-160-lines-of-javascript-44e0742ad60f)
|
| 186 |
+
* [**JavaScript**: _Learn how React Reconciler package works by building your own lightweight React DOM_](https://hackernoon.com/learn-you-some-custom-react-renderers-aed7164a4199)
|
| 187 |
+
* [**JavaScript**: _Build Yourself a Redux_](https://zapier.com/engineering/how-to-build-redux/)
|
| 188 |
+
* [**JavaScript**: _Let’s Write Redux!_](https://www.jamasoftware.com/blog/lets-write-redux/)
|
| 189 |
+
* [**JavaScript**: _Redux: Implementing Store from Scratch_](https://egghead.io/lessons/react-redux-implementing-store-from-scratch) [video]
|
| 190 |
+
* [**JavaScript**: _Build Your own Simplified AngularJS in 200 Lines of JavaScript_](https://blog.mgechev.com/2015/03/09/build-learn-your-own-light-lightweight-angularjs/)
|
| 191 |
+
* [**JavaScript**: _Make Your Own AngularJS_](http://teropa.info/blog/2013/11/03/make-your-own-angular-part-1-scopes-and-digest.html)
|
| 192 |
+
* [**JavaScript**: _How to write your own Virtual DOM_](https://medium.com/@deathmood/how-to-write-your-own-virtual-dom-ee74acc13060)
|
| 193 |
+
* [**JavaScript**: _Building a frontend framework, from scratch, with components (templating, state, VDOM)_](https://mfrachet.github.io/create-frontend-framework/)
|
| 194 |
+
* [**JavaScript**: _Build your own React_](https://pomb.us/build-your-own-react/)
|
| 195 |
+
* [**JavaScript**: _Building a Custom React Renderer_](https://youtu.be/CGpMlWVcHok) [video]
|
| 196 |
+
|
| 197 |
+
#### Build your own `Game`
|
| 198 |
+
|
| 199 |
+
* [**C**: _Handmade Hero_](https://handmadehero.org/)
|
| 200 |
+
* [**C**: _How to Program an NES game in C_](https://nesdoug.com/)
|
| 201 |
+
* [**C**: _Chess Engine In C_](https://www.youtube.com/playlist?list=PLZ1QII7yudbc-Ky058TEaOstZHVbT-2hg) [video]
|
| 202 |
+
* [**C**: _Let's Make: Dangerous Dave_](https://www.youtube.com/playlist?list=PLSkJey49cOgTSj465v2KbLZ7LMn10bCF9) [video]
|
| 203 |
+
* [**C**: _Learn Video Game Programming in C_](https://www.youtube.com/playlist?list=PLT6WFYYZE6uLMcPGS3qfpYm7T_gViYMMt)
|
| 204 |
+
[video]
|
| 205 |
+
* [**C**: _Coding A Sudoku Solver in C_](https://www.youtube.com/playlist?list=PLkTXsX7igf8edTYU92nU-f5Ntzuf-RKvW) [video]
|
| 206 |
+
* [**C**: _Coding a Rogue/Nethack RPG in C_](https://www.youtube.com/playlist?list=PLkTXsX7igf8erbWGYT4iSAhpnJLJ0Nk5G) [video]
|
| 207 |
+
* [**C**: _On Tetris and Reimplementation_](https://brennan.io/2015/06/12/tetris-reimplementation/)
|
| 208 |
+
* [**C++**: _Breakout_](https://learnopengl.com/In-Practice/2D-Game/Breakout)
|
| 209 |
+
* [**C++**: _Beginning Game Programming v2.0_](http://lazyfoo.net/tutorials/SDL/)
|
| 210 |
+
* [**C++**: _Tetris tutorial in C++ platform independent focused in game logic for beginners_](http://javilop.com/gamedev/tetris-tutorial-in-c-platform-independent-focused-in-game-logic-for-beginners/)
|
| 211 |
+
* [**C++**: _Remaking Cavestory in C++_](https://www.youtube.com/watch?v=ETvApbD5xRo&list=PLNOBk_id22bw6LXhrGfhVwqQIa-M2MsLa) [video]
|
| 212 |
+
* [**C++**: _Reconstructing Cave Story_](https://www.youtube.com/playlist?list=PL006xsVEsbKjSKBmLu1clo85yLrwjY67X) [video]
|
| 213 |
+
* [**C++**: _Space Invaders from Scratch_](http://nicktasios.nl/posts/space-invaders-from-scratch-part-1.html)
|
| 214 |
+
* [**C#**: _Learn C# by Building a Simple RPG_](http://scottlilly.com/learn-c-by-building-a-simple-rpg-index/)
|
| 215 |
+
* [**C#**: _Creating a Roguelike Game in C#_](https://roguesharp.wordpress.com/)
|
| 216 |
+
* [**C#**: _Build a C#/WPF RPG_](https://scottlilly.com/build-a-cwpf-rpg/)
|
| 217 |
+
* [**Go**: _Games With Go_](https://www.youtube.com/playlist?list=PLDZujg-VgQlZUy1iCqBbe5faZLMkA3g2x) [video]
|
| 218 |
+
* [**Java**: _Code a 2D Game Engine using Java - Full Course for Beginners_](https://www.youtube.com/watch?v=025QFeZfeyM) [video]
|
| 219 |
+
* [**Java**: _3D Game Development with LWJGL 3_](https://lwjglgamedev.gitbooks.io/3d-game-development-with-lwjgl/content/)
|
| 220 |
+
* [**JavaScript**: _2D breakout game using Phaser_](https://developer.mozilla.org/en-US/docs/Games/Tutorials/2D_breakout_game_Phaser)
|
| 221 |
+
* [**JavaScript**: _How to Make Flappy Bird in HTML5 With Phaser_](http://www.lessmilk.com/tutorial/flappy-bird-phaser-1)
|
| 222 |
+
* [**JavaScript**: _Developing Games with React, Redux, and SVG_](https://auth0.com/blog/developing-games-with-react-redux-and-svg-part-1/)
|
| 223 |
+
* [**JavaScript**: _Build your own 8-Ball Pool game from scratch_](https://www.youtube.com/watch?v=aXwCrtAo4Wc) [video]
|
| 224 |
+
* [**JavaScript**: _How to Make Your First Roguelike_](https://gamedevelopment.tutsplus.com/tutorials/how-to-make-your-first-roguelike--gamedev-13677)
|
| 225 |
+
* [**JavaScript**: _Think like a programmer: How to build Snake using only JavaScript, HTML & CSS_](https://medium.freecodecamp.org/think-like-a-programmer-how-to-build-snake-using-only-javascript-html-and-css-7b1479c3339e)
|
| 226 |
+
* [**Lua**: _BYTEPATH_](https://github.com/SSYGEN/blog/issues/30)
|
| 227 |
+
* [**Python**: _Developing Games With PyGame_](https://pythonprogramming.net/pygame-python-3-part-1-intro/)
|
| 228 |
+
* [**Python**: _Making Games with Python & Pygame_](https://inventwithpython.com/makinggames.pdf) [pdf]
|
| 229 |
+
* [**Python**: _Roguelike Tutorial Revised_](http://rogueliketutorials.com/)
|
| 230 |
+
* [**Ruby**: _Developing Games With Ruby_](https://leanpub.com/developing-games-with-ruby/read)
|
| 231 |
+
* [**Ruby**: _Ruby Snake_](https://www.diatomenterprises.com/gamedev-on-ruby-why-not/)
|
| 232 |
+
* [**Rust**: _Adventures in Rust: A Basic 2D Game_](https://a5huynh.github.io/posts/2018/adventures-in-rust/)
|
| 233 |
+
* [**Rust**: _Roguelike Tutorial in Rust + tcod_](https://tomassedovic.github.io/roguelike-tutorial/)
|
| 234 |
+
|
| 235 |
+
#### Build your own `Git`
|
| 236 |
+
|
| 237 |
+
* [**Haskell**: _Reimplementing “git clone” in Haskell from the bottom up_](http://stefan.saasen.me/articles/git-clone-in-haskell-from-the-bottom-up/)
|
| 238 |
+
* [**JavaScript**: _Gitlet_](http://gitlet.maryrosecook.com/docs/gitlet.html)
|
| 239 |
+
* [**JavaScript**: _Build GIT - Learn GIT_](https://kushagra.dev/blog/build-git-learn-git/)
|
| 240 |
+
* [**Python**: _Just enough of a Git client to create a repo, commit, and push itself to GitHub_](https://benhoyt.com/writings/pygit/)
|
| 241 |
+
* [**Python**: _Write yourself a Git!_](https://wyag.thb.lt/)
|
| 242 |
+
* [**Python**: _ugit: Learn Git Internals by Building Git Yourself_](https://www.leshenko.net/p/ugit/)
|
| 243 |
+
* [**Ruby**: _Rebuilding Git in Ruby_](https://robots.thoughtbot.com/rebuilding-git-in-ruby)
|
| 244 |
+
|
| 245 |
+
#### Build your own `Memory Allocator`
|
| 246 |
+
|
| 247 |
+
* [**C**: _Malloc is not magic -- Implementing your own memory allocator_](https://medium.com/p/e0354e914402)
|
| 248 |
+
|
| 249 |
+
#### Build your own `Network Stack`
|
| 250 |
+
|
| 251 |
+
* [**C**: _Beej's Guide to Network Programming_](http://beej.us/guide/bgnet/)
|
| 252 |
+
* [**C**: _Let's code a TCP/IP stack_](http://www.saminiir.com/lets-code-tcp-ip-stack-1-ethernet-arp/)
|
| 253 |
+
* [**C / Python**: _Build your own VPN/Virtual Switch_](https://github.com/peiyuanix/build-your-own-zerotier)
|
| 254 |
+
* [**Ruby**: _How to build a network stack in Ruby_](https://medium.com/geckoboard-under-the-hood/how-to-build-a-network-stack-in-ruby-f73aeb1b661b)
|
| 255 |
+
|
| 256 |
+
#### Build your own `Neural Network`
|
| 257 |
+
|
| 258 |
+
* [**C#**: _Neural Network OCR_](https://www.codeproject.com/Articles/11285/Neural-Network-OCR)
|
| 259 |
+
* [**F#**: _Building Neural Networks in F#: Part 1_](https://medium.com/data-science/building-neural-networks-in-f-part-1-a2832ae972e6)
|
| 260 |
+
* [**F#**: _Building Neural Networks in F#: Part 2_](https://medium.com/data-science/building-neural-networks-in-f-part-2-training-evaluation-5e3a68889da6)
|
| 261 |
+
* [**Go**: _Build a multilayer perceptron with Golang_](https://made2591.github.io/posts/neuralnetwork)
|
| 262 |
+
* [**Go**: _How to build a simple artificial neural network with Go_](https://sausheong.github.io/posts/how-to-build-a-simple-artificial-neural-network-with-go/)
|
| 263 |
+
* [**Go**: _Building a Neural Net from Scratch in Go_](https://datadan.io/blog/neural-net-with-go)
|
| 264 |
+
* [**JavaScript / Java**: _Neural Networks - The Nature of Code_](https://www.youtube.com/playlist?list=PLRqwX-V7Uu6aCibgK1PTWWu9by6XFdCfh) [video]
|
| 265 |
+
* [**JavaScript**: _Neural networks from scratch for JavaScript linguists (Part1 — The Perceptron)_](https://hackernoon.com/neural-networks-from-scratch-for-javascript-linguists-part1-the-perceptron-632a4d1fbad2)
|
| 266 |
+
* [**Python**: _A Neural Network in 11 lines of Python_](https://iamtrask.github.io/2015/07/12/basic-python-network/)
|
| 267 |
+
* [**Python**: _Build Deep Learning From Scratch (reimplement PyTorch internals across 34 stages)_](https://github.com/roiamiel1/Build-Deep-Learning-From-Scratch)
|
| 268 |
+
* [**Python**: _Implement a Neural Network from Scratch_](https://victorzhou.com/blog/intro-to-neural-networks/)
|
| 269 |
+
* [**Python**: _Optical Character Recognition (OCR)_](http://aosabook.org/en/500L/optical-character-recognition-ocr.html)
|
| 270 |
+
* [**Python**: _Traffic signs classification with a convolutional network_](https://navoshta.com/traffic-signs-classification/)
|
| 271 |
+
* [**Python**: _Generate Music using LSTM Neural Network in Keras_](https://towardsdatascience.com/how-to-generate-music-using-a-lstm-neural-network-in-keras-68786834d4c5)
|
| 272 |
+
* [**Python**: _An Introduction to Convolutional Neural Networks_](https://victorzhou.com/blog/intro-to-cnns-part-1/)
|
| 273 |
+
* [**Python**: _Neural Networks: Zero to Hero_](https://www.youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ)
|
| 274 |
+
* [**Python**: _SlowTorch: Implementation of PyTorch from the ground up in 100% pure Python_](https://github.com/xames3/slowtorch)
|
| 275 |
+
|
| 276 |
+
#### Build your own `Operating System`
|
| 277 |
+
|
| 278 |
+
* [**Assembly**: _Writing a Tiny x86 Bootloader_](http://joebergeron.io/posts/post_two.html)
|
| 279 |
+
* [**Assembly**: _Baking Pi – Operating Systems Development_](http://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/index.html)
|
| 280 |
+
* [**C**: _Building a software and hardware stack for a simple computer from scratch_](https://www.youtube.com/watch?v=ZjwvMcP3Nf0&list=PLU94OURih-CiP4WxKSMt3UcwMSDM3aTtX) [video]
|
| 281 |
+
* [**C**: _Operating Systems: From 0 to 1_](https://tuhdo.github.io/os01/)
|
| 282 |
+
* [**C**: _The little book about OS development_](https://littleosbook.github.io/)
|
| 283 |
+
* [**C**: _Roll your own toy UNIX-clone OS_](http://jamesmolloy.co.uk/tutorial_html/)
|
| 284 |
+
* [**C**: _Kernel 101 �� Let’s write a Kernel_](https://arjunsreedharan.org/post/82710718100/kernel-101-lets-write-a-kernel)
|
| 285 |
+
* [**C**: _Kernel 201 – Let’s write a Kernel with keyboard and screen support_](https://arjunsreedharan.org/post/99370248137/kernel-201-lets-write-a-kernel-with-keyboard)
|
| 286 |
+
* [**C**: _Build a minimal multi-tasking kernel for ARM from scratch_](https://github.com/jserv/mini-arm-os)
|
| 287 |
+
* [**C**: _How to create an OS from scratch_](https://github.com/cfenollosa/os-tutorial)
|
| 288 |
+
* [**C**: _Malloc tutorial_](https://danluu.com/malloc-tutorial/)
|
| 289 |
+
* [**C**: _Hack the virtual memory_](https://blog.holbertonschool.com/hack-the-virtual-memory-c-strings-proc/)
|
| 290 |
+
* [**C**: _Learning operating system development using Linux kernel and Raspberry Pi_](https://github.com/s-matyukevich/raspberry-pi-os)
|
| 291 |
+
* [**C**: _Operating systems development for Dummies_](https://medium.com/@lduck11007/operating-systems-development-for-dummies-3d4d786e8ac)
|
| 292 |
+
* [**C++**: _Write your own Operating System_](https://www.youtube.com/playlist?list=PLHh55M_Kq4OApWScZyPl5HhgsTJS9MZ6M) [video]
|
| 293 |
+
* [**C++**: _Writing a Bootloader_](http://3zanders.co.uk/2017/10/13/writing-a-bootloader/)
|
| 294 |
+
* [**Rust**: _Writing an OS in Rust_](https://os.phil-opp.com/)
|
| 295 |
+
* [**Rust**: _Add RISC-V Rust Operating System Tutorial_](https://osblog.stephenmarz.com/)
|
| 296 |
+
* [**(any)**: _Linux from scratch_](https://linuxfromscratch.org/lfs)
|
| 297 |
+
|
| 298 |
+
#### Build your own `Physics Engine`
|
| 299 |
+
|
| 300 |
+
* [**C**: _Video Game Physics Tutorial_](https://www.toptal.com/game/video-game-physics-part-i-an-introduction-to-rigid-body-dynamics)
|
| 301 |
+
* [**C++**: _Game physics series by Allen Chou_](http://allenchou.net/game-physics-series/)
|
| 302 |
+
* [**C++**: _How to Create a Custom Physics Engine_](https://gamedevelopment.tutsplus.com/series/how-to-create-a-custom-physics-engine--gamedev-12715)
|
| 303 |
+
* [**C++**: _3D Physics Engine Tutorial_](https://www.youtube.com/playlist?list=PLEETnX-uPtBXm1KEr_2zQ6K_0hoGH6JJ0) [video]
|
| 304 |
+
* [**JavaScript**: _How Physics Engines Work_](http://buildnewgames.com/gamephysics/)
|
| 305 |
+
* [**JavaScript**: _Broad Phase Collision Detection Using Spatial Partitioning_](http://buildnewgames.com/broad-phase-collision-detection/)
|
| 306 |
+
* [**JavaScript**: _Build a simple 2D physics engine for JavaScript games_](https://developer.ibm.com/tutorials/wa-build2dphysicsengine/?mhsrc=ibmsearch_a&mhq=2dphysic)
|
| 307 |
+
|
| 308 |
+
#### Build your own `Processor`
|
| 309 |
+
|
| 310 |
+
* [**Verilog**: _From Blinker to RISC-V_](https://github.com/BrunoLevy/learn-fpga/tree/master/FemtoRV/TUTORIALS/FROM_BLINKER_TO_RISCV)
|
| 311 |
+
|
| 312 |
+
#### Build your own `Programming Language`
|
| 313 |
+
|
| 314 |
+
* [**(any)**: _mal - Make a Lisp_](https://github.com/kanaka/mal#mal---make-a-lisp)
|
| 315 |
+
* [**Assembly**: _Jonesforth_](https://github.com/nornagon/jonesforth/blob/master/jonesforth.S)
|
| 316 |
+
* [**C**: _Baby's First Garbage Collector_](http://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/)
|
| 317 |
+
* [**C**: _Build Your Own Lisp: Learn C and build your own programming language in 1000 lines of code_](http://www.buildyourownlisp.com/)
|
| 318 |
+
* [**C**: _Writing a Simple Garbage Collector in C_](http://maplant.com/gc.html)
|
| 319 |
+
* [**C**: _C interpreter that interprets itself._](https://github.com/lotabout/write-a-C-interpreter)
|
| 320 |
+
* [**C**: _A C & x86 version of the "Let's Build a Compiler" by Jack Crenshaw_](https://github.com/lotabout/Let-s-build-a-compiler)
|
| 321 |
+
* [**C**: _A journey explaining how to build a compiler from scratch_](https://github.com/DoctorWkt/acwj)
|
| 322 |
+
* [**C++**: _Writing Your Own Toy Compiler Using Flex_](https://gnuu.org/2009/09/18/writing-your-own-toy-compiler/)
|
| 323 |
+
* [**C++**: _How to Create a Compiler_](https://www.youtube.com/watch?v=eF9qWbuQLuw) [video]
|
| 324 |
+
* [**C++**: _Kaleidoscope: Implementing a Language with LLVM_](https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html)
|
| 325 |
+
* [**F#**: _Understanding Parser Combinators_](https://fsharpforfunandprofit.com/posts/understanding-parser-combinators/)
|
| 326 |
+
* [**Elixir**: _Demystifying compilers by writing your own_](https://www.youtube.com/watch?v=zMJYoYwOCd4) [video]
|
| 327 |
+
* [**Go**: _The Super Tiny Compiler_](https://github.com/hazbo/the-super-tiny-compiler)
|
| 328 |
+
* [**Go**: _Lexical Scanning in Go_](https://www.youtube.com/watch?v=HxaD_trXwRE) [video]
|
| 329 |
+
* [**Haskell**: _Let's Build a Compiler_](https://g-ford.github.io/cradle/)
|
| 330 |
+
* [**Haskell**: _Write You a Haskell_](http://dev.stephendiehl.com/fun/)
|
| 331 |
+
* [**Haskell**: _Write Yourself a Scheme in 48 Hours_](https://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours)
|
| 332 |
+
* [**Haskell**: _Write You A Scheme_](https://www.wespiser.com/writings/wyas/home.html)
|
| 333 |
+
* [**Java**: _Crafting interpreters: A handbook for making programming languages_](http://www.craftinginterpreters.com/)
|
| 334 |
+
* [**Java**: _Creating JVM Language_](http://jakubdziworski.github.io/categories.html#Enkel-ref)
|
| 335 |
+
* [**JavaScript**: _The Super Tiny Compiler_](https://github.com/jamiebuilds/the-super-tiny-compiler)
|
| 336 |
+
* [**JavaScript**: _The Super Tiny Interpreter_](https://github.com/keyanzhang/the-super-tiny-interpreter)
|
| 337 |
+
* [**JavaScript**: _Little Lisp interpreter_](https://maryrosecook.com/blog/post/little-lisp-interpreter)
|
| 338 |
+
* [**JavaScript**: _How to implement a programming language in JavaScript_](http://lisperator.net/pltut/)
|
| 339 |
+
* [**JavaScript**: _Let’s go write a Lisp_](https://idiocy.org/lets-go-write-a-lisp/part-1.html)
|
| 340 |
+
* [**OCaml**: _Writing a C Compiler_](https://norasandler.com/2017/11/29/Write-a-Compiler.html)
|
| 341 |
+
* [**OCaml**: _Writing a Lisp, the series_](https://bernsteinbear.com/blog/lisp/)
|
| 342 |
+
* [**Pascal**: _Let's Build a Compiler_](https://compilers.iecc.com/crenshaw/)
|
| 343 |
+
* [**Python**: _A Python Interpreter Written in Python_](http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html)
|
| 344 |
+
* [**Python**: _lisp.py: Make your own Lisp interpreter_](http://khamidou.com/compilers/lisp.py/)
|
| 345 |
+
* [**Python**: _How to Write a Lisp Interpreter in Python_](http://norvig.com/lispy.html)
|
| 346 |
+
* [**Python**: _Let’s Build A Simple Interpreter_](https://ruslanspivak.com/lsbasi-part1/)
|
| 347 |
+
* [**Python**: _Make Your Own Simple Interpreted Programming Language_](https://www.youtube.com/watch?v=dj9CBS3ikGA&list=PLZQftyCk7_SdoVexSmwy_tBgs7P0b97yD&index=1) [video]
|
| 348 |
+
* [**Python**: _From Source Code To Machine Code: Build Your Own Compiler From Scratch_](https://build-your-own.org/compiler/)
|
| 349 |
+
* [**Racket**: _Beautiful Racket: How to make your own programming languages with Racket_](https://beautifulracket.com/)
|
| 350 |
+
* [**Ruby**: _A Compiler From Scratch_](https://www.destroyallsoftware.com/screencasts/catalog/a-compiler-from-scratch)
|
| 351 |
+
* [**Ruby**: _Markdown compiler from scratch in Ruby_](https://blog.beezwax.net/2017/07/07/writing-a-markdown-compiler/)
|
| 352 |
+
* [**Rust**: _Learning Parser Combinators With Rust_](https://bodil.lol/parser-combinators/)
|
| 353 |
+
* [**Swift**: _Building a LISP from scratch with Swift_](https://www.uraimo.com/2017/02/05/building-a-lisp-from-scratch-with-swift/)
|
| 354 |
+
* [**TypeScript**: _Build your own WebAssembly Compiler_](https://blog.scottlogic.com/2019/05/17/webassembly-compiler.html)
|
| 355 |
+
|
| 356 |
+
#### Build your own `Regex Engine`
|
| 357 |
+
|
| 358 |
+
* [**C**: _A Regular Expression Matcher_](https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html)
|
| 359 |
+
* [**C**: _Regular Expression Matching Can Be Simple And Fast_](https://swtch.com/~rsc/regexp/regexp1.html)
|
| 360 |
+
* [**Go**: _How to build a regex engine from scratch_](https://rhaeguard.github.io/posts/regex)
|
| 361 |
+
* [**JavaScript**: _Build a Regex Engine in Less than 40 Lines of Code_](https://nickdrane.com/build-your-own-regex/)
|
| 362 |
+
* [**JavaScript**: _How to implement regular expressions in functional javascript using derivatives_](http://dpk.io/dregs/toydregs)
|
| 363 |
+
* [**JavaScript**: _Implementing a Regular Expression Engine_](https://deniskyashif.com/2019/02/17/implementing-a-regular-expression-engine/)
|
| 364 |
+
* [**Perl**: _How Regexes Work_](https://perl.plover.com/Regex/article.html)
|
| 365 |
+
* [**Python**: _Build Your Own Regular Expression Engines: Backtracking, NFA, DFA_](https://build-your-own.org/b2a/r0_intro)
|
| 366 |
+
* [**Scala**: _No Magic: Regular Expressions_](https://rcoh.svbtle.com/no-magic-regular-expressions)
|
| 367 |
+
|
| 368 |
+
#### Build your own `Search Engine`
|
| 369 |
+
|
| 370 |
+
* [**CSS**: _A search engine in CSS_](https://stories.algolia.com/a-search-engine-in-css-b5ec4e902e97)
|
| 371 |
+
* [**Python**: _Building a search engine using Redis and redis-py_](http://www.dr-josiah.com/2010/07/building-search-engine-using-redis-and.html)
|
| 372 |
+
* [**Python**: _Building a Vector Space Indexing Engine in Python_](https://boyter.org/2010/08/build-vector-space-search-engine-python/)
|
| 373 |
+
* [**Python**: _Building A Python-Based Search Engine_](https://www.youtube.com/watch?v=cY7pE7vX6MU) [video]
|
| 374 |
+
* [**Python**: _Making text search learn from feedback_](https://medium.com/filament-ai/making-text-search-learn-from-feedback-4fe210fd87b0)
|
| 375 |
+
* [**Python**: _Finding Important Words in Text Using TF-IDF_](https://stevenloria.com/tf-idf/)
|
| 376 |
+
|
| 377 |
+
#### Build your own `Shell`
|
| 378 |
+
|
| 379 |
+
* [**C**: _Tutorial - Write a Shell in C_](https://brennan.io/2015/01/16/write-a-shell-in-c/)
|
| 380 |
+
* [**C**: _Let's build a shell!_](https://github.com/kamalmarhubi/shell-workshop)
|
| 381 |
+
* [**C**: _Writing a UNIX Shell_](https://indradhanush.github.io/blog/writing-a-unix-shell-part-1/)
|
| 382 |
+
* [**C**: _Build Your Own Shell_](https://github.com/tokenrove/build-your-own-shell)
|
| 383 |
+
* [**C**: Write a shell in C](https://danishpraka.sh/posts/write-a-shell/)
|
| 384 |
+
* [**Go**: _Writing a simple shell in Go_](https://sj14.gitlab.io/post/2018-07-01-go-unix-shell/)
|
| 385 |
+
* [**Rust**: _Build Your Own Shell using Rust_](https://www.joshmcguigan.com/blog/build-your-own-shell-rust/)
|
| 386 |
+
|
| 387 |
+
#### Build your own `Template Engine`
|
| 388 |
+
|
| 389 |
+
* [**JavaScript**: _JavaScript template engine in just 20 lines_](http://krasimirtsonev.com/blog/article/Javascript-template-engine-in-just-20-line)
|
| 390 |
+
* [**JavaScript**: _Understanding JavaScript Micro-Templating_](https://medium.com/wdstack/understanding-javascript-micro-templating-f37a37b3b40e)
|
| 391 |
+
* [**Python**: _Approach: Building a toy template engine in Python_](http://alexmic.net/building-a-template-engine/)
|
| 392 |
+
* [**Python**: _A Template Engine_](http://aosabook.org/en/500L/a-template-engine.html)
|
| 393 |
+
* [**Ruby**: _How to write a template engine in less than 30 lines of code_](http://bits.citrusbyte.com/how-to-write-a-template-library/)
|
| 394 |
+
|
| 395 |
+
#### Build your own `Text Editor`
|
| 396 |
+
|
| 397 |
+
* [**C**: _Build Your Own Text Editor_](https://viewsourcecode.org/snaptoken/kilo/)
|
| 398 |
+
* [**C++**: _Designing a Simple Text Editor_](http://www.fltk.org/doc-1.1/editor.html)
|
| 399 |
+
* [**Python**: _Python Tutorial: Make Your Own Text Editor_](https://www.youtube.com/watch?v=xqDonHEYPgA) [video]
|
| 400 |
+
* [**Python**: _Create a Simple Python Text Editor!_](http://www.instructables.com/id/Create-a-Simple-Python-Text-Editor/)
|
| 401 |
+
* [**Ruby**: _Build a Collaborative Text Editor Using Rails_](https://blog.aha.io/text-editor/)
|
| 402 |
+
* [**Rust**: _Hecto: Build your own text editor in Rust_ ](https://www.flenker.blog/hecto/)
|
| 403 |
+
|
| 404 |
+
#### Build your own `Visual Recognition System`
|
| 405 |
+
|
| 406 |
+
* [**Python**: _Developing a License Plate Recognition System with Machine Learning in Python_](https://medium.com/devcenter/developing-a-license-plate-recognition-system-with-machine-learning-in-python-787833569ccd)
|
| 407 |
+
* [**Python**: _Building a Facial Recognition Pipeline with Deep Learning in Tensorflow_](https://hackernoon.com/building-a-facial-recognition-pipeline-with-deep-learning-in-tensorflow-66e7645015b8)
|
| 408 |
+
|
| 409 |
+
#### Build your own `Voxel Engine`
|
| 410 |
+
|
| 411 |
+
* [**C++**: _Let's Make a Voxel Engine_](https://sites.google.com/site/letsmakeavoxelengine/home)
|
| 412 |
+
|
| 413 |
+
#### Build your own `Web Browser`
|
| 414 |
+
|
| 415 |
+
* [**Rust**: _Let's build a browser engine_](https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html)
|
| 416 |
+
* [**Python**: _Browser Engineering_](https://browser.engineering)
|
| 417 |
+
|
| 418 |
+
#### Build your own `Web Server`
|
| 419 |
+
|
| 420 |
+
* [**C#**: _Writing a Web Server from Scratch_](https://www.codeproject.com/Articles/859108/Writing-a-Web-Server-from-Scratch)
|
| 421 |
+
* [**Node.js**: _Build Your Own Web Server From Scratch In JavaScript_](https://build-your-own.org/webserver/)
|
| 422 |
+
* [**Node.js**: _Let's code a web server from scratch with NodeJS Streams_](https://www.codementor.io/@ziad-saab/let-s-code-a-web-server-from-scratch-with-nodejs-streams-h4uc9utji)
|
| 423 |
+
* [**Node.js**: _lets-build-express_](https://github.com/antoaravinth/lets-build-express)
|
| 424 |
+
* [**PHP**: _Writing a webserver in pure PHP_](http://station.clancats.com/writing-a-webserver-in-pure-php/)
|
| 425 |
+
* [**Python**: _A Simple Web Server_](http://aosabook.org/en/500L/a-simple-web-server.html)
|
| 426 |
+
* [**Python**: _Let’s Build A Web Server._](https://ruslanspivak.com/lsbaws-part1/)
|
| 427 |
+
* [**Python**: _Web application from scratch_](https://defn.io/2018/02/25/web-app-from-scratch-01/)
|
| 428 |
+
* [**Python**: _Building a basic HTTP Server from scratch in Python_](http://joaoventura.net/blog/2017/python-webserver/)
|
| 429 |
+
* [**Python**: _Implementing a RESTful Web API with Python & Flask_](http://blog.luisrei.com/articles/flaskrest.html)
|
| 430 |
+
* [**Ruby**: _Building a simple websockets server from scratch in Ruby_](http://blog.honeybadger.io/building-a-simple-websockets-server-from-scratch-in-ruby/)
|
| 431 |
+
|
| 432 |
+
#### Uncategorized
|
| 433 |
+
|
| 434 |
+
* [**(any)**: _From NAND to Tetris: Building a Modern Computer From First Principles_](http://nand2tetris.org/)
|
| 435 |
+
* [**(any)**: build-your-own-x-vibe-coding: BYOX-style tutorials adapted for vibe coding](https://github.com/inFaaa/build-your-own-x-vibe-coding)
|
| 436 |
+
* [**Alloy**: _The Same-Origin Policy_](http://aosabook.org/en/500L/the-same-origin-policy.html)
|
| 437 |
+
* [**C**: _How to Write a Video Player in Less Than 1000 Lines_](http://dranger.com/ffmpeg/ffmpeg.html)
|
| 438 |
+
* [**C**: _Learn how to write a hash table in C_](https://github.com/jamesroutley/write-a-hash-table)
|
| 439 |
+
* [**C**: _The very basics of a terminal emulator_](https://www.uninformativ.de/blog/postings/2018-02-24/0/POSTING-en.html)
|
| 440 |
+
* [**C**: _Write a System Call_](https://brennan.io/2016/11/14/kernel-dev-ep3/)
|
| 441 |
+
* [**C**: _Sol - An MQTT broker from scratch_](https://codepr.github.io/posts/sol-mqtt-broker)
|
| 442 |
+
* [**C++**: _Build your own VR headset for $200_](https://github.com/relativty/Relativ)
|
| 443 |
+
* [**C++**: _How X Window Managers work and how to write one_](https://seasonofcode.com/posts/how-x-window-managers-work-and-how-to-write-one-part-i.html)
|
| 444 |
+
* [**C++**: _Writing a Linux Debugger_](https://blog.tartanllama.xyz/writing-a-linux-debugger-setup/)
|
| 445 |
+
* [**C++**: _How a 64k intro is made_](http://www.lofibucket.com/articles/64k_intro.html)
|
| 446 |
+
* [**C++**: _Make your own Game Engine_](https://www.youtube.com/playlist?list=PLlrATfBNZ98dC-V-N3m0Go4deliWHPFwT)
|
| 447 |
+
* [**C#**: _C# Networking: Create a TCP chater server, TCP games, UDP Pong and more_](https://16bpp.net/tutorials/csharp-networking)
|
| 448 |
+
* [**C#**: _Loading and rendering 3D skeletal animations from scratch in C# and GLSL_](https://www.seanjoflynn.com/research/skeletal-animation.html)
|
| 449 |
+
* [**Clojure**: _Building a spell-checker_](https://bernhardwenzel.com/articles/clojure-spellchecker/)
|
| 450 |
+
* [**Go**: _Build A Simple Terminal Emulator In 100 Lines of Golang_](https://ishuah.com/2021/03/10/build-a-terminal-emulator-in-100-lines-of-go/)
|
| 451 |
+
* [**Go**: _Let's Create a Simple Load Balancer_](https://kasvith.me/posts/lets-create-a-simple-lb-go/)
|
| 452 |
+
* [**Go**: _Video Encoding from Scratch_](https://github.com/kevmo314/codec-from-scratch)
|
| 453 |
+
* [**Java**: _How to Build an Android Reddit App_](https://www.youtube.com/playlist?list=PLgCYzUzKIBE9HUJU-upNvl3TRVAo9W47y) [video]
|
| 454 |
+
* [**JavaScript**: _Build Your Own Module Bundler - Minipack_](https://github.com/ronami/minipack)
|
| 455 |
+
* [**JavaScript**: _Learn JavaScript Promises by Building a Promise from Scratch_](https://levelup.gitconnected.com/understand-javascript-promises-by-building-a-promise-from-scratch-84c0fd855720)
|
| 456 |
+
* [**JavaScript**: _Implementing promises from scratch (TDD way)_](https://www.mauriciopoppe.com/notes/computer-science/computation/promises/)
|
| 457 |
+
* [**JavaScript**: _Implement your own — call(), apply() and bind() method in JavaScript_](https://blog.usejournal.com/implement-your-own-call-apply-and-bind-method-in-javascript-42cc85dba1b)
|
| 458 |
+
* [**JavaScript**: _JavaScript Algorithms and Data Structures_](https://github.com/trekhleb/javascript-algorithms)
|
| 459 |
+
* [**JavaScript**: _Build a ride hailing app with React Native_](https://pusher.com/tutorials/ride-hailing-react-native)
|
| 460 |
+
* [**JavaScript**: _Build Your Own AdBlocker in (Literally) 10 Minutes_](https://levelup.gitconnected.com/building-your-own-adblocker-in-literally-10-minutes-1eec093b04cd)
|
| 461 |
+
* [**Kotlin**: _Build Your Own Cache_](https://github.com/kezhenxu94/cache-lite)
|
| 462 |
+
* [**Lua**: _Building a CDN from Scratch to Learn about CDN_](https://github.com/leandromoreira/cdn-up-and-running)
|
| 463 |
+
* [**Nim**: _Writing a Redis Protocol Parser_](https://xmonader.github.io/nimdays/day12_resp.html)
|
| 464 |
+
* [**Nim**: _Writing a Build system_](https://xmonader.github.io/nimdays/day11_buildsystem.html)
|
| 465 |
+
* [**Nim**: _Writing a MiniTest Framework_](https://xmonader.github.io/nimdays/day08_minitest.html)
|
| 466 |
+
* [**Nim**: _Writing a DMIDecode Parser_](https://xmonader.github.io/nimdays/day01_dmidecode.html)
|
| 467 |
+
* [**Nim**: _Writing a INI Parser_](https://xmonader.github.io/nimdays/day05_iniparser.html)
|
| 468 |
+
* [**Nim**: _Writing a Link Checker_](https://xmonader.github.io/nimdays/day04_asynclinkschecker.html)
|
| 469 |
+
* [**Nim**: _Writing a URL Shortening Service_](https://xmonader.github.io/nimdays/day07_shorturl.html)
|
| 470 |
+
* [**Node.js**: _Build a static site generator in 40 lines with Node.js_](https://www.webdevdrops.com/en/build-static-site-generator-nodejs-8969ebe34b22/)
|
| 471 |
+
* [**Node.js**: _Building A Simple Single Sign On(SSO) Server And Solution From Scratch In Node.js._](https://codeburst.io/building-a-simple-single-sign-on-sso-server-and-solution-from-scratch-in-node-js-ea6ee5fdf340)
|
| 472 |
+
* [**Node.js**: _How to create a real-world Node CLI app with Node_](https://medium.freecodecamp.org/how-to-create-a-real-world-node-cli-app-with-node-391b727bbed3)
|
| 473 |
+
* [**Node.js**: _Build a DNS Server in Node.js_](https://engineerhead.github.io/dns-server/)
|
| 474 |
+
* [**Node.js**: _Build a Synchronization Engine with Node.js and Y.js_](https://greenvitriol.com/posts/sync-engine-for-everyone)
|
| 475 |
+
* [**PHP**: _Write your own MVC from scratch in PHP_ ](https://chaitya62.github.io/2018/04/29/Writing-your-own-MVC-from-Scratch-in-PHP.html)
|
| 476 |
+
* [**PHP**: _Make your own blog_](https://ilovephp.jondh.me.uk/en/tutorial/make-your-own-blog)
|
| 477 |
+
* [**PHP**: _Modern PHP Without a Framework_](https://kevinsmith.io/modern-php-without-a-framework)
|
| 478 |
+
* [**PHP**: _Code a Web Search Engine in PHP_](https://boyter.org/2013/01/code-for-a-search-engine-in-php-part-1/)
|
| 479 |
+
* [**Python**: _Build a Deep Learning Library_](https://www.youtube.com/watch?v=o64FV-ez6Gw) [video]
|
| 480 |
+
* [**Python**: _How to Build a Kick-Ass Mobile Document Scanner in Just 5 Minutes_](https://www.pyimagesearch.com/2014/09/01/build-kick-ass-mobile-document-scanner-just-5-minutes/)
|
| 481 |
+
* [**Python**: _Continuous Integration System_](http://aosabook.org/en/500L/a-continuous-integration-system.html)
|
| 482 |
+
* [**Python**: _Recommender Systems in Python: Beginner Tutorial_](https://www.datacamp.com/community/tutorials/recommender-systems-python)
|
| 483 |
+
* [**Python**: _Write SMS-spam detector with Scikit-learn_](https://medium.com/@kopilov.vlad/detect-sms-spam-in-kaggle-with-scikit-learn-5f6afa7a3ca2)
|
| 484 |
+
* [**Python**: _A Simple Content-Based Recommendation Engine in Python_](http://blog.untrod.com/2016/06/simple-similar-products-recommendation-engine-in-python.html)
|
| 485 |
+
* [**Python**: _Stock Market Predictions with LSTM in Python_](https://www.datacamp.com/community/tutorials/lstm-python-stock-market)
|
| 486 |
+
* [**Python**: _Building a simple Generative Adversarial Network (GAN) using Tensorflow_](https://blog.paperspace.com/implementing-gans-in-tensorflow/)
|
| 487 |
+
* [**Python**: _Learn ML Algorithms by coding: Decision Trees_](https://lethalbrains.com/learn-ml-algorithms-by-coding-decision-trees-439ac503c9a4)
|
| 488 |
+
* [**Python**: _JSON Decoding Algorithm_](https://github.com/cheery/json-algorithm)
|
| 489 |
+
* [**Python**: _Build your own Git plugin with python_](https://joshburns-xyz.vercel.app/posts/build-your-own-git-plugin)
|
| 490 |
+
* [**Ruby**: _A Pedometer in the Real World_](http://aosabook.org/en/500L/a-pedometer-in-the-real-world.html)
|
| 491 |
+
* [**Ruby**: _Creating a Linux Desktop application with Ruby_](https://iridakos.com/tutorials/2018/01/25/creating-a-gtk-todo-application-with-ruby)
|
| 492 |
+
* [**Rust**: _Building a DNS server in Rust_](https://github.com/EmilHernvall/dnsguide/blob/master/README.md)
|
| 493 |
+
* [**Rust**: _Writing Scalable Chat Service from Scratch_](https://nbaksalyar.github.io/2015/07/10/writing-chat-in-rust.html)
|
| 494 |
+
* [**Rust**: _WebGL + Rust: Basic Water Tutorial_](https://www.chinedufn.com/3d-webgl-basic-water-tutorial/)
|
| 495 |
+
* [**TypeScript**: _Tiny Package Manager: Learns how npm or Yarn works_](https://github.com/g-plane/tiny-package-manager)
|
| 496 |
+
|
| 497 |
+
## Contribute
|
| 498 |
+
* Submissions welcome, just send a PR, or [create an issue](https://github.com/codecrafters-io/build-your-own-x/issues/new)
|
| 499 |
+
* Help us review [pending submissions](https://github.com/codecrafters-io/build-your-own-x/issues) by leaving comments and "reactions"
|
| 500 |
+
|
| 501 |
+
## Origins & License
|
| 502 |
+
|
| 503 |
+
[](https://creativecommons.org/publicdomain/zero/1.0/)
|
| 504 |
+
|
| 505 |
+
This repository is the work of [many contributors](https://github.com/codecrafters-io/build-your-own-x/graphs/contributors). It was started by [Daniel Stefanovic](https://github.com/danistefanovic), and is now maintained by [CodeCrafters, Inc.](https://codecrafters.io) To the extent possible under law, [CodeCrafters, Inc.](https://codecrafters.io) has waived all copyright and related or neighboring rights to this work.
|
github_code/codecrafters-io__build-your-own-x/codecrafters-banner.png
ADDED
|
Git LFS Details
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/codespace-env.sh
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
[[ -n "${CODESPACE_NAME:-}" ]] || exit 0
|
| 7 |
+
|
| 8 |
+
set_env() {
|
| 9 |
+
local key=$1 value=$2 tmp
|
| 10 |
+
tmp=$(mktemp)
|
| 11 |
+
trap 'rm -f "$tmp"' RETURN
|
| 12 |
+
awk -v k="$key" -v v="$value" '
|
| 13 |
+
index($0, k "=") == 1 { print k "=" v; found = 1; next }
|
| 14 |
+
{ print }
|
| 15 |
+
END { if (!found) print k "=" v }
|
| 16 |
+
' .env >"$tmp"
|
| 17 |
+
cat "$tmp" >.env
|
| 18 |
+
}
|
| 19 |
+
|
| 20 |
+
domain=${GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN:-app.github.dev}
|
| 21 |
+
set_env HOME_LOCATION "https://${CODESPACE_NAME}-8000.${domain}"
|
| 22 |
+
set_env API_LOCATION "https://${CODESPACE_NAME}-3000.${domain}"
|
| 23 |
+
printf 'Codespace detected. HOME_LOCATION and API_LOCATION in .env now use %s.\n' "$domain"
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/devcontainer.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "freeCodeCamp",
|
| 3 |
+
"dockerComposeFile": ["../docker/docker-compose.yml", "docker-compose.yml"],
|
| 4 |
+
"service": "devcontainer",
|
| 5 |
+
"workspaceFolder": "/workspaces/freeCodeCamp",
|
| 6 |
+
"hostRequirements": {
|
| 7 |
+
"cpus": 4,
|
| 8 |
+
"memory": "16gb",
|
| 9 |
+
"storage": "32gb"
|
| 10 |
+
},
|
| 11 |
+
"mounts": [
|
| 12 |
+
"source=fcc-node-modules,target=${containerWorkspaceFolder}/node_modules,type=volume"
|
| 13 |
+
],
|
| 14 |
+
"forwardPorts": [8000, 3000, 8025],
|
| 15 |
+
"portsAttributes": {
|
| 16 |
+
"8000": { "label": "Client", "onAutoForward": "notify" },
|
| 17 |
+
"3000": { "label": "API", "onAutoForward": "silent" },
|
| 18 |
+
"8025": { "label": "Mailpit", "onAutoForward": "silent" }
|
| 19 |
+
},
|
| 20 |
+
"otherPortsAttributes": { "onAutoForward": "silent" },
|
| 21 |
+
"onCreateCommand": ".devcontainer/on-create.sh",
|
| 22 |
+
"updateContentCommand": "pnpm install --prefer-offline",
|
| 23 |
+
// post-create.sh runs codespace-env.sh. That rewrite must not move to
|
| 24 |
+
// onCreateCommand: a prebuild snapshots the container after onCreateCommand
|
| 25 |
+
// and would freeze the wrong hostname.
|
| 26 |
+
"postCreateCommand": ".devcontainer/post-create.sh",
|
| 27 |
+
// Codespaces resets port visibility on stop, and postCreateCommand does
|
| 28 |
+
// not run again on a restart.
|
| 29 |
+
"postStartCommand": ".devcontainer/post-start.sh",
|
| 30 |
+
"postAttachCommand": ".devcontainer/welcome.sh",
|
| 31 |
+
"customizations": {
|
| 32 |
+
"vscode": {
|
| 33 |
+
"extensions": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"],
|
| 34 |
+
"settings": {
|
| 35 |
+
"tasks": {
|
| 36 |
+
"version": "2.0.0",
|
| 37 |
+
"tasks": [
|
| 38 |
+
{
|
| 39 |
+
"label": "Start freeCodeCamp",
|
| 40 |
+
"type": "shell",
|
| 41 |
+
"command": "pnpm run develop",
|
| 42 |
+
"isBackground": true,
|
| 43 |
+
"problemMatcher": [],
|
| 44 |
+
"presentation": { "reveal": "always", "panel": "dedicated" }
|
| 45 |
+
}
|
| 46 |
+
]
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/docker-compose.yml
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: freecodecamp-devcontainer
|
| 2 |
+
|
| 3 |
+
services:
|
| 4 |
+
devcontainer:
|
| 5 |
+
image: ghcr.io/freecodecamp/devcontainer:latest
|
| 6 |
+
# gatsby develop defaults to host `localhost`. Where the network namespace
|
| 7 |
+
# has IPv6, glibc RFC 6724 precedence resolves that to ::1 first, so the
|
| 8 |
+
# dev server binds IPv6 loopback only and port forwarding, which connects
|
| 9 |
+
# over IPv4, is refused. 0.0.0.0 needs no AF_INET6 socket, so it also holds
|
| 10 |
+
# where IPv6 is switched off.
|
| 11 |
+
environment:
|
| 12 |
+
GATSBY_HOST: 0.0.0.0
|
| 13 |
+
volumes:
|
| 14 |
+
- ..:/workspaces/freeCodeCamp:cached
|
| 15 |
+
# Shares the db network namespace so MONGOHQ_URL and MAILPIT_HOST in
|
| 16 |
+
# sample.env resolve on localhost. A service in that namespace cannot
|
| 17 |
+
# publish a port, which is why the host ports live in a separate overlay.
|
| 18 |
+
network_mode: service:db
|
| 19 |
+
command: sleep infinity
|
| 20 |
+
depends_on:
|
| 21 |
+
db:
|
| 22 |
+
condition: service_healthy
|
| 23 |
+
setup:
|
| 24 |
+
condition: service_completed_successfully
|
| 25 |
+
mailpit:
|
| 26 |
+
condition: service_started
|
| 27 |
+
|
| 28 |
+
mailpit:
|
| 29 |
+
# Same namespace, for MAILPIT_HOST=localhost.
|
| 30 |
+
network_mode: service:db
|
| 31 |
+
depends_on:
|
| 32 |
+
db:
|
| 33 |
+
condition: service_healthy
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/on-create.sh
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
sudo chown node:node node_modules
|
| 7 |
+
|
| 8 |
+
[[ -f .env ]] || cp sample.env .env
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/post-create.sh
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
cd "$(dirname "$0")/.."
|
| 5 |
+
|
| 6 |
+
wait_for_primary() {
|
| 7 |
+
for _ in $(seq 1 30); do
|
| 8 |
+
if mongosh --quiet --eval 'if (!db.hello().isWritablePrimary) quit(1)' >/dev/null 2>&1; then
|
| 9 |
+
return 0
|
| 10 |
+
fi
|
| 11 |
+
sleep 2
|
| 12 |
+
done
|
| 13 |
+
return 1
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
rsync -a --include='*/' --include='.turbo/***' --exclude='*' /home/node/.cache/fcc/ ./
|
| 17 |
+
|
| 18 |
+
.devcontainer/codespace-env.sh
|
| 19 |
+
|
| 20 |
+
if ! wait_for_primary; then
|
| 21 |
+
printf 'MongoDB did not become writable. Run "docker compose ps" to inspect the services.\n' >&2
|
| 22 |
+
exit 1
|
| 23 |
+
fi
|
| 24 |
+
|
| 25 |
+
set -a
|
| 26 |
+
# shellcheck disable=SC1091
|
| 27 |
+
. ./.env
|
| 28 |
+
set +a
|
| 29 |
+
|
| 30 |
+
pnpm seed
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/post-start.sh
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
# Runs on every start, including a resume. Codespaces resets port visibility
|
| 5 |
+
# when a codespace stops, and postCreateCommand does not run again.
|
| 6 |
+
[[ -n "${CODESPACE_NAME:-}" ]] || exit 0
|
| 7 |
+
|
| 8 |
+
for attempt in 1 2; do
|
| 9 |
+
status=0
|
| 10 |
+
err=$(timeout 20 gh codespace ports visibility 3000:public -c "$CODESPACE_NAME" 2>&1) || status=$?
|
| 11 |
+
|
| 12 |
+
if [[ $status -eq 0 ]]; then
|
| 13 |
+
printf 'Port 3000 is public, so the client can reach the API.\n'
|
| 14 |
+
printf 'Anybody with the URL can reach it, and the development sign-in\n'
|
| 15 |
+
printf 'route needs no password. Stop the codespace when you finish.\n'
|
| 16 |
+
exit 0
|
| 17 |
+
fi
|
| 18 |
+
|
| 19 |
+
if [[ $status -eq 124 ]]; then
|
| 20 |
+
err="gh timed out after 20 seconds"
|
| 21 |
+
fi
|
| 22 |
+
|
| 23 |
+
if [[ $status -eq 127 ]]; then
|
| 24 |
+
err="gh is not installed"
|
| 25 |
+
break
|
| 26 |
+
fi
|
| 27 |
+
|
| 28 |
+
if [[ $attempt -lt 2 ]]; then
|
| 29 |
+
sleep 5
|
| 30 |
+
fi
|
| 31 |
+
done
|
| 32 |
+
|
| 33 |
+
printf 'gh could not set the port: %s\n' "$err" >&2
|
| 34 |
+
cat <<'MSG'
|
| 35 |
+
|
| 36 |
+
Port 3000 is private, so the client cannot reach the API yet.
|
| 37 |
+
Open the Ports panel, right click port 3000, then choose Port Visibility,
|
| 38 |
+
then Public.
|
| 39 |
+
|
| 40 |
+
A public port is reachable by anybody who has the URL, and the development
|
| 41 |
+
sign-in route needs no password. Stop the codespace when you finish working.
|
| 42 |
+
|
| 43 |
+
MSG
|
github_code/freeCodeCamp__freeCodeCamp/.devcontainer/welcome.sh
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env bash
|
| 2 |
+
set -euo pipefail
|
| 3 |
+
|
| 4 |
+
cat <<'MSG'
|
| 5 |
+
|
| 6 |
+
freeCodeCamp is ready. Dependencies are installed, MongoDB is running,
|
| 7 |
+
and a test user is seeded.
|
| 8 |
+
|
| 9 |
+
Open a new terminal and start the development script:
|
| 10 |
+
|
| 11 |
+
pnpm run develop
|
| 12 |
+
|
| 13 |
+
Read the setup and troubleshooting guide before you begin:
|
| 14 |
+
|
| 15 |
+
https://contribute.freecodecamp.org/how-to-setup-freecodecamp-locally/
|
| 16 |
+
|
| 17 |
+
MSG
|
github_code/freeCodeCamp__freeCodeCamp/.dockerignore
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
client/.cache
|
| 2 |
+
client/public
|
| 3 |
+
.env
|
| 4 |
+
.git
|
| 5 |
+
.gitignore
|
| 6 |
+
.dockerignore
|
| 7 |
+
docker/**/Dockerfile
|
| 8 |
+
**/*docker-compose*
|
| 9 |
+
**/node_modules
|
| 10 |
+
.eslintcache
|
| 11 |
+
|
github_code/freeCodeCamp__freeCodeCamp/.editorconfig
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
root = true
|
| 2 |
+
|
| 3 |
+
[*]
|
| 4 |
+
indent_style = space
|
| 5 |
+
indent_size = 2
|
| 6 |
+
end_of_line = lf
|
| 7 |
+
charset = utf-8
|
| 8 |
+
trim_trailing_whitespace = true
|
| 9 |
+
insert_final_newline = true
|
| 10 |
+
|
| 11 |
+
[package.json]
|
| 12 |
+
indent_style = space
|
| 13 |
+
indent_size = 2
|
| 14 |
+
|
| 15 |
+
[*.md]
|
| 16 |
+
trim_trailing_whitespace = false
|
github_code/freeCodeCamp__freeCodeCamp/.gitattributes
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
* text=auto eol=lf
|
| 2 |
+
|
| 3 |
+
# These files are binary and should be left untouched
|
| 4 |
+
*.eot binary
|
| 5 |
+
*.gif binary
|
| 6 |
+
*.ico binary
|
| 7 |
+
*.jpeg binary
|
| 8 |
+
*.jpg binary
|
| 9 |
+
*.mov binary
|
| 10 |
+
*.mp3 binary
|
| 11 |
+
*.mp4 binary
|
| 12 |
+
*.pdf binary
|
| 13 |
+
*.png binary
|
| 14 |
+
*.ttf binary
|
| 15 |
+
*.woff binary
|
github_code/freeCodeCamp__freeCodeCamp/.github/.well-known/funding-manifest-urls
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
https://www.freecodecamp.org/funding.json
|
github_code/freeCodeCamp__freeCodeCamp/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# -------------------------------------------------
|
| 2 |
+
# CODEOWNERS - For automated review request for
|
| 3 |
+
# high impact files.
|
| 4 |
+
#
|
| 5 |
+
# Important: The order in this file cascades.
|
| 6 |
+
#
|
| 7 |
+
# https://help.github.com/articles/about-codeowners
|
| 8 |
+
# -------------------------------------------------
|
| 9 |
+
|
| 10 |
+
# -------------------------------------------------
|
| 11 |
+
# Files that need attention from primary teams
|
| 12 |
+
# -------------------------------------------------
|
| 13 |
+
|
| 14 |
+
# --- All files
|
| 15 |
+
* @freecodecamp/dev-team @freecodecamp/curriculum
|
| 16 |
+
|
| 17 |
+
# --- Package files for negation ---
|
| 18 |
+
|
| 19 |
+
**/package.json @freecodecamp/none
|
| 20 |
+
**/pnpm-lock.yaml @freecodecamp/none
|
| 21 |
+
|
| 22 |
+
# -------------------------------------------------
|
| 23 |
+
# Files that need attention from i18n & dev team
|
| 24 |
+
# -------------------------------------------------
|
| 25 |
+
|
| 26 |
+
# i18n Quotes
|
| 27 |
+
**/motivation.json @freeCodeCamp/dev-team @freeCodeCamp/i18n
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
# -------------------------------------------------
|
| 31 |
+
# Files that need attention from the mobile team
|
| 32 |
+
# -------------------------------------------------
|
| 33 |
+
|
| 34 |
+
/client/src/redux/prop-types.ts @freeCodeCamp/dev-team @freeCodeCamp/mobile
|
| 35 |
+
/client/tools/external-curriculum/* @freeCodeCamp/dev-team @freeCodeCamp/mobile
|
| 36 |
+
/curriculum/schema/challenge-schema.js @freeCodeCamp/dev-team @freeCodeCamp/mobile
|
github_code/freeCodeCamp__freeCodeCamp/.github/FUNDING.yml
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
github: freecodecamp
|
| 2 |
+
patreon: freecodecamp
|
| 3 |
+
custom: [www.freecodecamp.org/donate]
|
github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/01--issues-with-coding-challenges.yml
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Issue - Content in our Coding Challenges
|
| 2 |
+
description: Report issues with a specific challenge, like broken tests, unclear instructions, etc.
|
| 3 |
+
type: Bug
|
| 4 |
+
labels: ['scope: curriculum', 'status: waiting triage']
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: If you're reporting a security issue, don't create a GitHub issue. Instead, visit https://contribute.freecodecamp.org/#/security.
|
| 9 |
+
- type: textarea
|
| 10 |
+
attributes:
|
| 11 |
+
label: Describe the Issue
|
| 12 |
+
description: A clear and concise description of the issue you encountered.
|
| 13 |
+
validations:
|
| 14 |
+
required: true
|
| 15 |
+
- type: input
|
| 16 |
+
attributes:
|
| 17 |
+
label: Affected Page
|
| 18 |
+
description: Add a link to the coding challenge with the problem.
|
| 19 |
+
validations:
|
| 20 |
+
required: true
|
| 21 |
+
- type: textarea
|
| 22 |
+
attributes:
|
| 23 |
+
label: Your code
|
| 24 |
+
description: Copy and paste the code from the editor that you used in between the back-ticks.
|
| 25 |
+
value: |
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
```
|
| 31 |
+
validations:
|
| 32 |
+
required: true
|
| 33 |
+
- type: textarea
|
| 34 |
+
attributes:
|
| 35 |
+
label: Expected behavior
|
| 36 |
+
description: Add a clear and concise description of what you expected to happen.
|
| 37 |
+
validations:
|
| 38 |
+
required: true
|
| 39 |
+
- type: textarea
|
| 40 |
+
attributes:
|
| 41 |
+
label: Screenshots
|
| 42 |
+
description: If applicable, add screenshots to help explain your problem. You can drag and drop `png`, `jpg`, `gif`, etc. in this box.
|
| 43 |
+
validations:
|
| 44 |
+
required: false
|
| 45 |
+
- type: textarea
|
| 46 |
+
attributes:
|
| 47 |
+
label: System
|
| 48 |
+
description: Please complete the following information.
|
| 49 |
+
value: |
|
| 50 |
+
- Device: [e.g. iPhone 6, Laptop]
|
| 51 |
+
- OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
|
| 52 |
+
- Browser: [e.g. Chrome, Safari]
|
| 53 |
+
- Version: [e.g. 22]
|
| 54 |
+
validations:
|
| 55 |
+
required: true
|
| 56 |
+
- type: textarea
|
| 57 |
+
attributes:
|
| 58 |
+
label: Additional context
|
| 59 |
+
description: Add any other context about the problem here.
|
| 60 |
+
validations:
|
| 61 |
+
required: false
|
github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/02--issues-with-software-on-platforms.yml
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Issue - User Interface on our Platforms
|
| 2 |
+
description: Report a software bug on /learn, /news, Community Forum, Code Radio, or any of the platforms.
|
| 3 |
+
type: Bug
|
| 4 |
+
labels: ['status: waiting triage']
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: If you're reporting a security issue, don't create a GitHub issue. Instead, visit https://contribute.freecodecamp.org/#/security.
|
| 9 |
+
- type: textarea
|
| 10 |
+
attributes:
|
| 11 |
+
label: Describe the Issue
|
| 12 |
+
description: A clear and concise description of the issue you encountered.
|
| 13 |
+
validations:
|
| 14 |
+
required: true
|
| 15 |
+
- type: input
|
| 16 |
+
attributes:
|
| 17 |
+
label: Affected Page
|
| 18 |
+
description: Add a link to the page with the problem.
|
| 19 |
+
validations:
|
| 20 |
+
required: true
|
| 21 |
+
- type: textarea
|
| 22 |
+
attributes:
|
| 23 |
+
label: Steps to Reproduce
|
| 24 |
+
description: Please provide the steps to reproduce the issue.
|
| 25 |
+
value: |
|
| 26 |
+
1. Go to '...'
|
| 27 |
+
2. Click on '...'
|
| 28 |
+
3. Scroll down to '...'
|
| 29 |
+
4. See error
|
| 30 |
+
validations:
|
| 31 |
+
required: true
|
| 32 |
+
- type: textarea
|
| 33 |
+
attributes:
|
| 34 |
+
label: Expected behavior
|
| 35 |
+
description: Add a clear and concise description of what you expected to happen.
|
| 36 |
+
validations:
|
| 37 |
+
required: true
|
| 38 |
+
- type: textarea
|
| 39 |
+
attributes:
|
| 40 |
+
label: Screenshots
|
| 41 |
+
description: If applicable, add screenshots to help explain your problem. You can drag and drop `png`, `jpg`, `gif`, etc. in this box.
|
| 42 |
+
validations:
|
| 43 |
+
required: false
|
| 44 |
+
- type: textarea
|
| 45 |
+
attributes:
|
| 46 |
+
label: System
|
| 47 |
+
description: Please complete the following information.
|
| 48 |
+
value: |
|
| 49 |
+
- Device: [e.g. iPhone 6, Laptop]
|
| 50 |
+
- OS: [e.g. iOS 14, Windows 10, Ubuntu 20.04]
|
| 51 |
+
- Browser: [e.g. Chrome, Safari]
|
| 52 |
+
- Version: [e.g. 22]
|
| 53 |
+
validations:
|
| 54 |
+
required: true
|
| 55 |
+
- type: textarea
|
| 56 |
+
attributes:
|
| 57 |
+
label: Additional context
|
| 58 |
+
description: Add any other context about the problem here.
|
| 59 |
+
validations:
|
| 60 |
+
required: false
|
github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/03--issues-with-content-on-articles-and-docs.yml
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Issues - Content in our Articles and other Documentation
|
| 2 |
+
description: Report issues with content on a specific article, like broken links, typos, missing parts, etc.
|
| 3 |
+
type: Bug
|
| 4 |
+
labels: ['status: waiting triage']
|
| 5 |
+
body:
|
| 6 |
+
- type: markdown
|
| 7 |
+
attributes:
|
| 8 |
+
value: 'NOTE: If you want to become an author on freeCodeCamp, you can find everything here: https://www.freecodecamp.org/news/developer-news-style-guide'
|
| 9 |
+
- type: markdown
|
| 10 |
+
attributes:
|
| 11 |
+
value: If you are reporting an issue with an article on our news publication, please follow this link to send an email to our editorial team https://mailxto.com/lkj5n7
|
| 12 |
+
- type: textarea
|
| 13 |
+
attributes:
|
| 14 |
+
label: Describe the Issue
|
| 15 |
+
description: A clear and concise description of the issue you encountered.
|
| 16 |
+
validations:
|
| 17 |
+
required: true
|
| 18 |
+
- type: input
|
| 19 |
+
attributes:
|
| 20 |
+
label: Affected Page
|
| 21 |
+
description: Add a link to the article or documentation page with the problem.
|
| 22 |
+
validations:
|
| 23 |
+
required: true
|
| 24 |
+
- type: textarea
|
| 25 |
+
attributes:
|
| 26 |
+
label: Steps to Reproduce
|
| 27 |
+
description: Please describe the problem and provide the steps to reproduce the issue.
|
| 28 |
+
validations:
|
| 29 |
+
required: true
|
| 30 |
+
- type: textarea
|
| 31 |
+
attributes:
|
| 32 |
+
label: Recommended fix or suggestions
|
| 33 |
+
description: A clear and concise description of how you want to update it.
|
| 34 |
+
validations:
|
| 35 |
+
required: true
|
| 36 |
+
- type: textarea
|
| 37 |
+
attributes:
|
| 38 |
+
label: Screenshots
|
| 39 |
+
description: If applicable, add screenshots to help explain your problem. You can drag and drop `png`, `jpg`, `gif`, etc. in this box.
|
| 40 |
+
validations:
|
| 41 |
+
required: false
|
github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/04--feature-request-for-freecodecamp-org-s-platforms.yml
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: New Feature - Request a new feature for our Platforms
|
| 2 |
+
description: Suggest an idea for freeCodeCamp.org's /learn, /news, Community Forum, Code Radio, or other platforms.
|
| 3 |
+
type: Enhancement
|
| 4 |
+
labels: ['status: waiting triage']
|
| 5 |
+
body:
|
| 6 |
+
- type: textarea
|
| 7 |
+
attributes:
|
| 8 |
+
label: Is your feature request related to a problem? Please describe.
|
| 9 |
+
description: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
| 10 |
+
validations:
|
| 11 |
+
required: true
|
| 12 |
+
- type: textarea
|
| 13 |
+
attributes:
|
| 14 |
+
label: Describe the solution you'd like
|
| 15 |
+
description: A clear and concise description of what you want to happen.
|
| 16 |
+
validations:
|
| 17 |
+
required: true
|
| 18 |
+
- type: textarea
|
| 19 |
+
attributes:
|
| 20 |
+
label: Describe alternatives you've considered
|
| 21 |
+
description: A clear and concise description of any alternative solutions or features you've considered.
|
| 22 |
+
validations:
|
| 23 |
+
required: true
|
| 24 |
+
- type: textarea
|
| 25 |
+
attributes:
|
| 26 |
+
label: Additional context
|
| 27 |
+
description: Add any other context or screenshots about the feature request here.
|
| 28 |
+
validations:
|
| 29 |
+
required: false
|
github_code/freeCodeCamp__freeCodeCamp/.github/ISSUE_TEMPLATE/config.yml
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
blank_issues_enabled: true
|
| 2 |
+
contact_links:
|
| 3 |
+
- name: Request programming help with coding challenges
|
| 4 |
+
url: https://forum.freecodecamp.org
|
| 5 |
+
about: Please visit this page for general support and programming help on coding challenges.
|
| 6 |
+
- name: Report issues with content on /news articles
|
| 7 |
+
url: https://mailxto.com/lkj5n7
|
| 8 |
+
about: Please fill out an email to our editorial team to report issues on specific articles on our technical publication (link opens an email template)
|
| 9 |
+
- name: Request technical support for your freeCodeCamp account
|
| 10 |
+
url: https://www.freecodecamp.org/support
|
| 11 |
+
about: Please visit this page for requesting technical support related to your freeCodeCamp account.
|
github_code/freeCodeCamp__freeCodeCamp/.github/PULL_REQUEST_TEMPLATE.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Checklist:
|
| 2 |
+
|
| 3 |
+
<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that our team takes your pull request seriously. -->
|
| 4 |
+
|
| 5 |
+
- [ ] I have read and followed the [contribution guidelines](https://contribute.freecodecamp.org).
|
| 6 |
+
- [ ] I have read and followed the [how to open a pull request guide](https://contribute.freecodecamp.org/how-to-open-a-pull-request/).
|
| 7 |
+
- [ ] My pull request targets the `main` branch of freeCodeCamp.
|
| 8 |
+
- [ ] I have tested these changes either locally on my machine, or GitHub Codespaces.
|
| 9 |
+
|
| 10 |
+
<!--If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.-->
|
| 11 |
+
|
| 12 |
+
Closes #XXXXX
|
| 13 |
+
|
| 14 |
+
<!-- Feel free to add any additional description of changes below this line -->
|
github_code/freeCodeCamp__freeCodeCamp/.github/actions/setup-turbo-cache/action.yml
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Caching Behaviour:
|
| 2 |
+
# ┌─────────────────────────┬─────────────────┬──────────────────┐
|
| 3 |
+
# │ Context │ Can Read Cache? │ Can Write Cache? │
|
| 4 |
+
# ├─────────────────────────┼─────────────────┼──────────────────┤
|
| 5 |
+
# │ main (push) │ YES │ YES │
|
| 6 |
+
# ├─────────────────────────┼─────────────────┼──────────────────┤
|
| 7 |
+
# │ PRs / temp-* / hotfix-* │ YES │ NO │
|
| 8 |
+
# ├─────────────────────────┼─────────────────┼──────────────────┤
|
| 9 |
+
# │ prod-* │ NO │ NO │
|
| 10 |
+
# ├─────────────────────────┼─────────────────┼──────────────────┤
|
| 11 |
+
# │ Fork PRs │ NO │ NO │
|
| 12 |
+
# └─────────────────────────┴─────────────────┴──────────────────┘
|
| 13 |
+
|
| 14 |
+
name: 'Setup Turbo Remote Cache'
|
| 15 |
+
description: 'Conditionally configure Turbo remote cache based on branch and event context'
|
| 16 |
+
|
| 17 |
+
inputs:
|
| 18 |
+
turbo-token:
|
| 19 |
+
description: 'Turbo remote cache authentication token'
|
| 20 |
+
required: true
|
| 21 |
+
turbo-signature-key:
|
| 22 |
+
description: 'Turbo remote cache signature key for artifact signing/verification'
|
| 23 |
+
required: true
|
| 24 |
+
|
| 25 |
+
runs:
|
| 26 |
+
using: 'composite'
|
| 27 |
+
steps:
|
| 28 |
+
- name: Configure Turbo Remote Cache
|
| 29 |
+
shell: bash
|
| 30 |
+
env:
|
| 31 |
+
TURBO_TOKEN: ${{ inputs.turbo-token }}
|
| 32 |
+
TURBO_SIGNATURE_KEY: ${{ inputs.turbo-signature-key }}
|
| 33 |
+
GITHUB_REF_NAME: ${{ github.ref_name }}
|
| 34 |
+
GITHUB_EVENT_NAME: ${{ github.event_name }}
|
| 35 |
+
GITHUB_BASE_REF: ${{ github.base_ref }}
|
| 36 |
+
run: |
|
| 37 |
+
echo "::group::Turbo Cache Configuration"
|
| 38 |
+
echo "Branch: $GITHUB_REF_NAME"
|
| 39 |
+
echo "Event: $GITHUB_EVENT_NAME"
|
| 40 |
+
echo "Base ref: $GITHUB_BASE_REF"
|
| 41 |
+
|
| 42 |
+
# Skip for deployment branches (pure builds)
|
| 43 |
+
if [[ "$GITHUB_REF_NAME" == prod-* ]]; then
|
| 44 |
+
echo "::notice::Deployment branch detected - Turbo cache DISABLED for pure build"
|
| 45 |
+
echo "::endgroup::"
|
| 46 |
+
exit 0
|
| 47 |
+
fi
|
| 48 |
+
|
| 49 |
+
# Skip if secrets are not available (fork PRs)
|
| 50 |
+
if [[ -z "$TURBO_TOKEN" || -z "$TURBO_SIGNATURE_KEY" ]]; then
|
| 51 |
+
echo "::notice::Turbo secrets not available (likely a fork PR) - Turbo cache DISABLED"
|
| 52 |
+
echo "::endgroup::"
|
| 53 |
+
exit 0
|
| 54 |
+
fi
|
| 55 |
+
|
| 56 |
+
# Base configuration for all other contexts
|
| 57 |
+
echo "TURBO_API=https://turbo-cache.freecodecamp.net" >> $GITHUB_ENV
|
| 58 |
+
echo "TURBO_TEAM=team_freecodecamp" >> $GITHUB_ENV
|
| 59 |
+
echo "TURBO_TOKEN=$TURBO_TOKEN" >> $GITHUB_ENV
|
| 60 |
+
echo "TURBO_REMOTE_CACHE_SIGNATURE_KEY=$TURBO_SIGNATURE_KEY" >> $GITHUB_ENV
|
| 61 |
+
echo "TURBO_TELEMETRY_DISABLED=1" >> $GITHUB_ENV
|
| 62 |
+
|
| 63 |
+
# Determine if this context should have write access
|
| 64 |
+
# Write access: main branch push
|
| 65 |
+
# Read-only: PRs and other branches (can read from cache, can't pollute it)
|
| 66 |
+
if [[ "$GITHUB_REF_NAME" == "main" && "$GITHUB_EVENT_NAME" == "push" ]]; then
|
| 67 |
+
echo "::notice::Main branch push - Turbo cache READ/WRITE enabled"
|
| 68 |
+
else
|
| 69 |
+
# All other contexts: read-only
|
| 70 |
+
# Use TURBO_CACHE=remote:r for read-only remote cache (local still read/write)
|
| 71 |
+
echo "TURBO_CACHE=local:rw,remote:r" >> $GITHUB_ENV
|
| 72 |
+
echo "::notice::PR/other branch - Turbo cache READ-ONLY enabled"
|
| 73 |
+
fi
|
| 74 |
+
|
| 75 |
+
echo "::endgroup::"
|
github_code/freeCodeCamp__freeCodeCamp/.github/copilot-instructions.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# GitHub Copilot Code Review Instructions
|
| 2 |
+
|
| 3 |
+
## Core Principles
|
| 4 |
+
|
| 5 |
+
**BE EXTREMELY MINIMAL.** Only provide actionable feedback.
|
| 6 |
+
|
| 7 |
+
**Skip all non-essential content:**
|
| 8 |
+
- Do not generate "Pull request overview" sections
|
| 9 |
+
- Do not create "Changes:" lists describing what was changed
|
| 10 |
+
- Do not create "Reviewed changes" sections or tables
|
| 11 |
+
- Do not list files with change descriptions
|
| 12 |
+
- Do not count how many files were reviewed
|
| 13 |
+
- Do not summarize what the PR does (visible in the diff)
|
| 14 |
+
|
| 15 |
+
**Focus only on problems:**
|
| 16 |
+
- Comment ONLY on actual issues that need fixing
|
| 17 |
+
- Keep each comment 1-3 sentences
|
| 18 |
+
- If everything is correct, provide no output
|
| 19 |
+
|
| 20 |
+
**Bad example (from PR 65578):**
|
| 21 |
+
```
|
| 22 |
+
## Pull request overview
|
| 23 |
+
This PR addresses issue 65331 by replacing em dash characters...
|
| 24 |
+
|
| 25 |
+
### Reviewed changes
|
| 26 |
+
Copilot reviewed 4 out of 4 changed files...
|
| 27 |
+
|
| 28 |
+
| File | Description |
|
| 29 |
+
| ---- | ----------- |
|
| 30 |
+
| file1.md | Updated em dash in seed content |
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
**Good example (actionable feedback only):**
|
| 34 |
+
```
|
| 35 |
+
Line 46: Test will fail - `innerText` returns rendered `—`, not `—`.
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## Focus Areas
|
| 41 |
+
|
| 42 |
+
1. **Test Coverage** - Ensuring adequate testing for code changes
|
| 43 |
+
2. **Pull Request Guidelines** - Compliance with contribution standards
|
| 44 |
+
|
| 45 |
+
---
|
| 46 |
+
|
| 47 |
+
## Focus Area 1: Test Coverage
|
| 48 |
+
|
| 49 |
+
When reviewing pull requests, ensure adequate test coverage for code changes in JavaScript, TypeScript, JSX, and TSX files.
|
| 50 |
+
|
| 51 |
+
> Detailed test coverage rules are in `.github/instructions/testing.instructions.md`
|
| 52 |
+
|
| 53 |
+
### Quick Reference
|
| 54 |
+
|
| 55 |
+
| Location | Framework | File Pattern |
|
| 56 |
+
|----------|-----------|--------------|
|
| 57 |
+
| `api/` | Vitest | `*.test.ts` |
|
| 58 |
+
| `client/` | Vitest | `*.test.{ts,tsx}` |
|
| 59 |
+
| `e2e/` | Playwright | `*.spec.ts` |
|
| 60 |
+
|
| 61 |
+
### When to Comment
|
| 62 |
+
|
| 63 |
+
Only leave a comment if:
|
| 64 |
+
|
| 65 |
+
- The PR modifies JavaScript/TypeScript/JSX/TSX code (bug fixes or new features)
|
| 66 |
+
- AND there are no corresponding test additions or updates
|
| 67 |
+
|
| 68 |
+
### When NOT to Comment
|
| 69 |
+
|
| 70 |
+
Do not comment if:
|
| 71 |
+
|
| 72 |
+
- Changes are only to documentation, configuration, or non-JS/TS files
|
| 73 |
+
- The PR includes appropriate test coverage for the changes
|
| 74 |
+
- Changes are test-only modifications
|
| 75 |
+
|
| 76 |
+
### Comment Style
|
| 77 |
+
|
| 78 |
+
If tests are missing, provide ONE brief comment:
|
| 79 |
+
|
| 80 |
+
```
|
| 81 |
+
Missing tests for [specific file]. Consider:
|
| 82 |
+
- [specific scenario]
|
| 83 |
+
- [edge case]
|
| 84 |
+
```
|
| 85 |
+
|
| 86 |
+
If test coverage is sufficient, **DO NOT COMMENT**. No "LGTM" needed.
|
| 87 |
+
|
| 88 |
+
---
|
| 89 |
+
|
| 90 |
+
## Focus Area 2: Pull Request Guidelines
|
| 91 |
+
|
| 92 |
+
When reviewing pull requests, verify compliance with [freeCodeCamp's contribution standards](https://contribute.freecodecamp.org/how-to-open-a-pull-request).
|
| 93 |
+
|
| 94 |
+
### PR Title Format
|
| 95 |
+
|
| 96 |
+
Check that the title follows conventional commits format:
|
| 97 |
+
`<type>([optional scope]): <description>`
|
| 98 |
+
|
| 99 |
+
**Valid types:** `fix`, `feat`, `refactor`, `docs`, `test`
|
| 100 |
+
|
| 101 |
+
**Common scopes:** `curriculum`, `client`, `api`, `i18n`, `a11y`, `tools`
|
| 102 |
+
|
| 103 |
+
Flag if:
|
| 104 |
+
|
| 105 |
+
- Title is vague (e.g., "Update file", "Fix bug", "Changes")
|
| 106 |
+
- Missing type prefix
|
| 107 |
+
- Description exceeds ~50 characters
|
| 108 |
+
- Type doesn't match the actual changes
|
| 109 |
+
|
| 110 |
+
Example of good title:
|
| 111 |
+
|
| 112 |
+
```
|
| 113 |
+
fix(client): resolve login button alignment on mobile
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
Example of bad title:
|
| 117 |
+
|
| 118 |
+
```
|
| 119 |
+
Fixed stuff
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
### PR Description & Issue Linking
|
| 123 |
+
|
| 124 |
+
Check for:
|
| 125 |
+
|
| 126 |
+
- Meaningful description explaining what changes were made and why
|
| 127 |
+
- Proper issue linking using `Closes #XXXXX` format (not just `#XXXXX`)
|
| 128 |
+
- Screenshots included for UI/visual changes
|
| 129 |
+
|
| 130 |
+
Flag if:
|
| 131 |
+
|
| 132 |
+
- Description is empty or only contains template boilerplate
|
| 133 |
+
- Issue reference uses incorrect format (e.g., `fixes XXXXX` without `#`)
|
| 134 |
+
- UI changes lack screenshots
|
| 135 |
+
|
| 136 |
+
### Checklist Completion
|
| 137 |
+
|
| 138 |
+
Verify the PR template checklist items are completed:
|
| 139 |
+
|
| 140 |
+
- Boxes should be checked (`[x]`) not left unchecked (`[ ]`)
|
| 141 |
+
- Placeholder text like `#XXXXX` should be replaced with actual issue numbers
|
| 142 |
+
|
| 143 |
+
Flag if:
|
| 144 |
+
|
| 145 |
+
- Checklist boxes are left unchecked
|
| 146 |
+
- Placeholder issue number `#XXXXX` remains unchanged
|
| 147 |
+
|
| 148 |
+
### Comment Style
|
| 149 |
+
|
| 150 |
+
Keep feedback minimal (one line when possible):
|
| 151 |
+
|
| 152 |
+
```
|
| 153 |
+
Update PR title to format: `<type>(scope): description`
|
| 154 |
+
See: https://contribute.freecodecamp.org/how-to-open-a-pull-request
|
| 155 |
+
```
|
| 156 |
+
|
| 157 |
+
```
|
| 158 |
+
Link issue using: `Closes #XXXXX`
|
| 159 |
+
```
|
| 160 |
+
|
| 161 |
+
If PR guidelines are followed, **DO NOT COMMENT**. No "LGTM" needed.
|
| 162 |
+
|
| 163 |
+
---
|
| 164 |
+
|
| 165 |
+
## General Guidelines
|
| 166 |
+
|
| 167 |
+
**Focus on Actionable Issues Only**
|
| 168 |
+
|
| 169 |
+
### Strict Rules
|
| 170 |
+
|
| 171 |
+
- NO summaries, overviews, or descriptions of changes
|
| 172 |
+
- NO tables or file listings
|
| 173 |
+
- NO "LGTM" or affirmative comments when everything is fine
|
| 174 |
+
- Only comment when action is required
|
| 175 |
+
- Keep each comment brief and actionable
|
| 176 |
+
|
| 177 |
+
### Prioritization
|
| 178 |
+
|
| 179 |
+
When multiple issues exist, address them in order of severity:
|
| 180 |
+
|
| 181 |
+
1. Security vulnerabilities or critical bugs
|
| 182 |
+
2. Missing test coverage for new functionality
|
| 183 |
+
3. Outdated tests for modified functionality
|
| 184 |
+
4. PR title/description compliance
|
| 185 |
+
|
| 186 |
+
Comment on all legitimate issues, but keep each comment concise.
|
github_code/freeCodeCamp__freeCodeCamp/.github/instructions/testing.instructions.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
applyTo: "**/*.{ts,tsx,js,jsx}"
|
| 3 |
+
---
|
| 4 |
+
|
| 5 |
+
# Test Coverage Review Instructions
|
| 6 |
+
|
| 7 |
+
Review code changes for adequate test coverage using freeCodeCamp's testing conventions.
|
| 8 |
+
|
| 9 |
+
## Testing Framework Reference
|
| 10 |
+
|
| 11 |
+
| Location | Framework | File Pattern | Notes |
|
| 12 |
+
|----------|-----------|--------------|-------|
|
| 13 |
+
| `api/` | Vitest | `*.test.ts` | Co-located with source |
|
| 14 |
+
| `client/` | Vitest | `*.test.{ts,tsx}` | Co-located with source |
|
| 15 |
+
| `e2e/` | Playwright | `*.spec.ts` | Dedicated directory |
|
| 16 |
+
|
| 17 |
+
## When to Flag Missing Tests
|
| 18 |
+
|
| 19 |
+
Comment on missing tests if ALL of these are true:
|
| 20 |
+
|
| 21 |
+
- PR modifies functional code (bug fix or new feature)
|
| 22 |
+
- No corresponding test additions or modifications exist
|
| 23 |
+
- Changes are not test-only or config-only
|
| 24 |
+
|
| 25 |
+
### Examples Requiring Tests
|
| 26 |
+
|
| 27 |
+
- New utility functions in `api/src/utils/` or `client/src/utils/`
|
| 28 |
+
- New API route handlers in `api/src/routes/`
|
| 29 |
+
- New React components with logic in `client/src/components/`
|
| 30 |
+
- Bug fixes that change application behavior
|
| 31 |
+
- New validation logic or data transformations
|
| 32 |
+
|
| 33 |
+
## When NOT to Flag
|
| 34 |
+
|
| 35 |
+
Do not comment on test coverage if:
|
| 36 |
+
|
| 37 |
+
- Changes are documentation, configuration, or non-functional
|
| 38 |
+
- PR already includes appropriate test coverage
|
| 39 |
+
- Changes are to test files themselves
|
| 40 |
+
- Changes are trivial:
|
| 41 |
+
- Import reorganization
|
| 42 |
+
- Formatting changes
|
| 43 |
+
- Type-only changes (interfaces, type definitions)
|
| 44 |
+
- Comment updates
|
| 45 |
+
- Changes are in areas without existing test patterns:
|
| 46 |
+
- Curriculum markdown files
|
| 47 |
+
- Configuration files
|
| 48 |
+
- Build scripts
|
| 49 |
+
|
| 50 |
+
## Detecting Outdated Tests
|
| 51 |
+
|
| 52 |
+
Flag if existing tests may be outdated:
|
| 53 |
+
|
| 54 |
+
- Test file exists for modified source but doesn't cover the changed functionality
|
| 55 |
+
- Test assertions reference behavior that is being changed
|
| 56 |
+
- Mock data doesn't reflect new data structures or API responses
|
| 57 |
+
- Test descriptions no longer match actual test behavior
|
| 58 |
+
|
| 59 |
+
### Example Comment for Outdated Tests
|
| 60 |
+
|
| 61 |
+
```
|
| 62 |
+
Tests in `src/utils/validate.test.ts` need updates for new validation rules.
|
| 63 |
+
```
|
| 64 |
+
|
| 65 |
+
## Comment Format
|
| 66 |
+
|
| 67 |
+
### Missing Tests
|
| 68 |
+
|
| 69 |
+
Brief, actionable feedback only:
|
| 70 |
+
|
| 71 |
+
```
|
| 72 |
+
Missing tests for `src/utils/validate.ts`:
|
| 73 |
+
- Valid input case
|
| 74 |
+
- Invalid input error
|
| 75 |
+
- Empty string edge case
|
| 76 |
+
```
|
| 77 |
+
|
| 78 |
+
### Sufficient Coverage
|
| 79 |
+
|
| 80 |
+
**DO NOT COMMENT.** Silence means approval.
|
| 81 |
+
|
| 82 |
+
### Outdated Tests
|
| 83 |
+
|
| 84 |
+
```
|
| 85 |
+
Tests in `[test file]` need updates for `[source file]` changes:
|
| 86 |
+
- [specific change]
|
| 87 |
+
```
|
| 88 |
+
|
| 89 |
+
## Test Quality Indicators
|
| 90 |
+
|
| 91 |
+
When tests are present, briefly verify:
|
| 92 |
+
|
| 93 |
+
- Tests cover the happy path
|
| 94 |
+
- Tests cover at least one error/edge case
|
| 95 |
+
- Test descriptions are meaningful (not just "test 1", "test 2")
|
| 96 |
+
- Mocks are appropriate (not mocking the thing being tested)
|
| 97 |
+
|
| 98 |
+
Do not block PRs for test style preferences if coverage is adequate.
|
github_code/freeCodeCamp__freeCodeCamp/.github/labeler.yml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'scope: curriculum':
|
| 2 |
+
- changed-files:
|
| 3 |
+
- any-glob-to-any-file: curriculum/challenges/**/*
|
| 4 |
+
|
| 5 |
+
'platform: learn':
|
| 6 |
+
- changed-files:
|
| 7 |
+
- any-glob-to-any-file: client/**/*
|
| 8 |
+
|
| 9 |
+
'platform: api':
|
| 10 |
+
- changed-files:
|
| 11 |
+
- any-glob-to-any-file: api/**/*
|
| 12 |
+
|
| 13 |
+
'scope: tools/scripts':
|
| 14 |
+
- changed-files:
|
| 15 |
+
- any-glob-to-any-file:
|
| 16 |
+
- tools/**/*
|
| 17 |
+
- .github/**/*
|
| 18 |
+
- utils/**/*
|
| 19 |
+
- e2e/**/*
|
| 20 |
+
|
| 21 |
+
'scope: i18n':
|
| 22 |
+
- changed-files:
|
| 23 |
+
- any-glob-to-any-file:
|
| 24 |
+
- client/i18n/**/*
|
| 25 |
+
- config/crowdin/**/*
|
| 26 |
+
- shared/config/i18n/**/*
|
github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/check-allow-list.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
module.exports = async ({ github, context, core }) => {
|
| 4 |
+
const prAuthor = context.payload.pull_request.user.login;
|
| 5 |
+
|
| 6 |
+
const teamSlugs = ['dev-team', 'curriculum', 'staff', 'moderators'];
|
| 7 |
+
const membershipChecks = teamSlugs.map(team_slug =>
|
| 8 |
+
github.rest.teams
|
| 9 |
+
.getMembershipForUserInOrg({
|
| 10 |
+
org: 'freeCodeCamp',
|
| 11 |
+
team_slug,
|
| 12 |
+
username: prAuthor
|
| 13 |
+
})
|
| 14 |
+
.then(({ data }) => data.state === 'active')
|
| 15 |
+
.catch(() => false)
|
| 16 |
+
);
|
| 17 |
+
const results = await Promise.all(membershipChecks);
|
| 18 |
+
const isOrgTeamMember = results.some(Boolean);
|
| 19 |
+
|
| 20 |
+
const isAllowListed =
|
| 21 |
+
isOrgTeamMember || ['camperbot', 'renovate[bot]'].includes(prAuthor);
|
| 22 |
+
|
| 23 |
+
core.setOutput('is_allow_listed', isAllowListed);
|
| 24 |
+
};
|
github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/check-pr-template.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
module.exports = async ({ github, context, core, isAllowListed }) => {
|
| 4 |
+
if (isAllowListed === 'true') return;
|
| 5 |
+
|
| 6 |
+
const body = (context.payload.pull_request.body || '').toLowerCase();
|
| 7 |
+
|
| 8 |
+
// The template must be present and the first 3 checkboxes must be
|
| 9 |
+
// ticked. The last checkbox (tested locally) is acceptable to leave
|
| 10 |
+
// unticked.
|
| 11 |
+
const templatePresent = body.includes('checklist:');
|
| 12 |
+
const requiredTicked = [
|
| 13 |
+
'i have read and followed the contribution guidelines',
|
| 14 |
+
'i have read and followed the how to open a pull request guide',
|
| 15 |
+
'my pull request targets the'
|
| 16 |
+
];
|
| 17 |
+
// Strip markdown links ([text](url) → text) before matching so contributors
|
| 18 |
+
// who omit the link syntax (e.g. type plain text) still pass the check.
|
| 19 |
+
const normalizedBody = body
|
| 20 |
+
.replace(/\[\s*x\s*\]/g, '[x]')
|
| 21 |
+
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1');
|
| 22 |
+
const allRequiredTicked = requiredTicked.every(item =>
|
| 23 |
+
normalizedBody.includes(`[x] ${item}`)
|
| 24 |
+
);
|
| 25 |
+
|
| 26 |
+
if (templatePresent && allRequiredTicked) return;
|
| 27 |
+
|
| 28 |
+
core.setOutput('failure_reason', 'incomplete_checklist');
|
| 29 |
+
core.setFailed(
|
| 30 |
+
'PR description is missing the required checklist or some items are incomplete.'
|
| 31 |
+
);
|
| 32 |
+
|
| 33 |
+
await github.rest.issues.addLabels({
|
| 34 |
+
owner: context.repo.owner,
|
| 35 |
+
repo: context.repo.repo,
|
| 36 |
+
issue_number: context.payload.pull_request.number,
|
| 37 |
+
labels: ['deprioritized']
|
| 38 |
+
});
|
| 39 |
+
};
|
github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/fix-pr-title.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
// Returns the minimum number of single-character edits (insert, delete, substitute)
|
| 4 |
+
// needed to turn string `a` into string `b`.
|
| 5 |
+
function levenshtein(a, b) {
|
| 6 |
+
const dp = Array.from({ length: a.length + 1 }, (_, i) =>
|
| 7 |
+
Array.from({ length: b.length + 1 }, (_, j) =>
|
| 8 |
+
i === 0 ? j : j === 0 ? i : 0
|
| 9 |
+
)
|
| 10 |
+
);
|
| 11 |
+
for (let i = 1; i <= a.length; i++) {
|
| 12 |
+
for (let j = 1; j <= b.length; j++) {
|
| 13 |
+
dp[i][j] =
|
| 14 |
+
a[i - 1] === b[j - 1]
|
| 15 |
+
? dp[i - 1][j - 1]
|
| 16 |
+
: 1 + Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]);
|
| 17 |
+
}
|
| 18 |
+
}
|
| 19 |
+
return dp[a.length][b.length];
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
module.exports = async ({ github, context }) => {
|
| 23 |
+
const title = context.payload.pull_request.title;
|
| 24 |
+
const ccRegex =
|
| 25 |
+
/^(feat|fix|refactor|docs|chore|build|ci|test|perf|revert)(\([^)]+\))?: .+/;
|
| 26 |
+
|
| 27 |
+
if (ccRegex.test(title)) return;
|
| 28 |
+
|
| 29 |
+
const types = [
|
| 30 |
+
'feat',
|
| 31 |
+
'fix',
|
| 32 |
+
'refactor',
|
| 33 |
+
'docs',
|
| 34 |
+
'chore',
|
| 35 |
+
'build',
|
| 36 |
+
'ci',
|
| 37 |
+
'test',
|
| 38 |
+
'perf',
|
| 39 |
+
'revert'
|
| 40 |
+
];
|
| 41 |
+
|
| 42 |
+
let newTitle = title;
|
| 43 |
+
|
| 44 |
+
// Fix 1: space between type and scope — "feat (scope):" → "feat(scope):"
|
| 45 |
+
newTitle = newTitle.replace(/^(\w+)\s+(\([^)]+\):)/, '$1$2');
|
| 46 |
+
|
| 47 |
+
// Fix 2: missing colon after scope — "feat(scope) desc" → "feat(scope): desc"
|
| 48 |
+
newTitle = newTitle.replace(/^(\w+\([^)]+\)) ([^:])/, '$1: $2');
|
| 49 |
+
|
| 50 |
+
// Fix 3: typo in type — "refator(scope):" → "refactor(scope):" (distance ≤ 2)
|
| 51 |
+
const typoMatch = newTitle.match(/^(\w+)(\([^)]+\))?:/);
|
| 52 |
+
if (typoMatch) {
|
| 53 |
+
const candidate = typoMatch[1];
|
| 54 |
+
if (!types.includes(candidate)) {
|
| 55 |
+
const closest = types
|
| 56 |
+
.map(t => ({ t, d: levenshtein(candidate, t) }))
|
| 57 |
+
.filter(x => x.d <= 2)
|
| 58 |
+
.sort((a, b) => a.d - b.d)[0];
|
| 59 |
+
if (closest) newTitle = newTitle.replace(candidate, closest.t);
|
| 60 |
+
}
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
// Fix 4: missing space after colon — "fix:desc" → "fix: desc"
|
| 64 |
+
newTitle = newTitle.replace(/^(\w+(?:\([^)]+\))?):(\S)/, '$1: $2');
|
| 65 |
+
|
| 66 |
+
// Catch-all: prefix with "fix: " if still not a valid CC title
|
| 67 |
+
if (!ccRegex.test(newTitle)) {
|
| 68 |
+
newTitle = `fix: ${newTitle}`;
|
| 69 |
+
}
|
| 70 |
+
|
| 71 |
+
if (newTitle !== title) {
|
| 72 |
+
await github.rest.pulls.update({
|
| 73 |
+
owner: context.repo.owner,
|
| 74 |
+
repo: context.repo.repo,
|
| 75 |
+
pull_number: context.payload.pull_request.number,
|
| 76 |
+
title: newTitle
|
| 77 |
+
});
|
| 78 |
+
}
|
| 79 |
+
};
|
github_code/freeCodeCamp__freeCodeCamp/.github/scripts/pr-guidelines/report-results.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
'use strict';
|
| 2 |
+
|
| 3 |
+
const FOOTER =
|
| 4 |
+
'\n\n---\nJoin us in our [chat room](https://discord.gg/PRyKn3Vbay) or our [forum](https://forum.freecodecamp.org/c/contributors/3) if you have any questions or need help with contributing.';
|
| 5 |
+
|
| 6 |
+
const TEMPLATE_BLOCK = [
|
| 7 |
+
'```md',
|
| 8 |
+
'Checklist:',
|
| 9 |
+
'',
|
| 10 |
+
'<!-- Please follow this checklist and put an x in each of the boxes, like this: [x]. It will ensure that our team takes your pull request seriously. -->',
|
| 11 |
+
'',
|
| 12 |
+
'- [ ] I have read and followed the [contribution guidelines](https://contribute.freecodecamp.org).',
|
| 13 |
+
'- [ ] I have read and followed the [how to open a pull request guide](https://contribute.freecodecamp.org/how-to-open-a-pull-request/).',
|
| 14 |
+
"- [ ] My pull request targets the `main` branch of freeCodeCamp.",
|
| 15 |
+
'- [ ] I have tested these changes either locally on my machine, or GitHub Codespaces.',
|
| 16 |
+
'',
|
| 17 |
+
'<!--If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.-->',
|
| 18 |
+
'',
|
| 19 |
+
'Closes #XXXXX',
|
| 20 |
+
'',
|
| 21 |
+
'<!-- Feel free to add any additional description of changes below this line -->',
|
| 22 |
+
'```'
|
| 23 |
+
].join('\n');
|
| 24 |
+
|
| 25 |
+
const MESSAGES = {
|
| 26 |
+
incomplete_checklist: [
|
| 27 |
+
'**Checklist:** The PR description is missing the required checklist or some of its items are not completed:',
|
| 28 |
+
'',
|
| 29 |
+
'1. The `Checklist:` heading is present in the PR description.',
|
| 30 |
+
'2. The checkbox items are ticked (changed from `[ ]` to `[x]`).',
|
| 31 |
+
'3. You have actually completed the items in the checklist.',
|
| 32 |
+
'',
|
| 33 |
+
'Please edit your PR description to include the following template with the checklist items completed.',
|
| 34 |
+
'',
|
| 35 |
+
TEMPLATE_BLOCK
|
| 36 |
+
].join('\n')
|
| 37 |
+
};
|
| 38 |
+
|
| 39 |
+
module.exports = async ({ github, context, templateResult, templateReason }) => {
|
| 40 |
+
const allPassed = templateResult === 'success';
|
| 41 |
+
|
| 42 |
+
if (allPassed) {
|
| 43 |
+
try {
|
| 44 |
+
await github.rest.issues.removeLabel({
|
| 45 |
+
owner: context.repo.owner,
|
| 46 |
+
repo: context.repo.repo,
|
| 47 |
+
issue_number: context.issue.number,
|
| 48 |
+
name: 'deprioritized'
|
| 49 |
+
});
|
| 50 |
+
} catch {
|
| 51 |
+
// Label may not exist — ignore.
|
| 52 |
+
}
|
| 53 |
+
return;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
// On edit, don't re-comment — the original comment is already there.
|
| 57 |
+
if (context.payload.action === 'edited') return;
|
| 58 |
+
|
| 59 |
+
const sections = [];
|
| 60 |
+
if (templateResult === 'failure' && MESSAGES[templateReason]) {
|
| 61 |
+
sections.push(MESSAGES[templateReason]);
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
if (sections.length === 0) return;
|
| 65 |
+
|
| 66 |
+
const body =
|
| 67 |
+
[
|
| 68 |
+
'Hi there,',
|
| 69 |
+
'',
|
| 70 |
+
'Thanks for opening this pull request.',
|
| 71 |
+
'',
|
| 72 |
+
'The automated checks found some issues:',
|
| 73 |
+
'',
|
| 74 |
+
sections.join('\n\n')
|
| 75 |
+
].join('\n') + FOOTER;
|
| 76 |
+
|
| 77 |
+
await github.rest.issues.createComment({
|
| 78 |
+
owner: context.repo.owner,
|
| 79 |
+
repo: context.repo.repo,
|
| 80 |
+
issue_number: context.issue.number,
|
| 81 |
+
body
|
| 82 |
+
});
|
| 83 |
+
};
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/crowdin-download.client-ui.yml
ADDED
|
@@ -0,0 +1,342 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: i18n - Download Client UI
|
| 2 |
+
on:
|
| 3 |
+
workflow_dispatch:
|
| 4 |
+
schedule:
|
| 5 |
+
# runs Monday and Wednesday at 12:15 PM UTC
|
| 6 |
+
- cron: '15 12 * * 1,3'
|
| 7 |
+
|
| 8 |
+
env:
|
| 9 |
+
GITHUB_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
| 10 |
+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
| 11 |
+
CROWDIN_API_URL: 'https://freecodecamp.crowdin.com/api/v2/'
|
| 12 |
+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CLIENT }}
|
| 13 |
+
|
| 14 |
+
permissions:
|
| 15 |
+
contents: read
|
| 16 |
+
|
| 17 |
+
jobs:
|
| 18 |
+
i18n-download-client-ui-translations:
|
| 19 |
+
name: Client
|
| 20 |
+
runs-on: ubuntu-24.04
|
| 21 |
+
|
| 22 |
+
steps:
|
| 23 |
+
- name: Checkout Source Files
|
| 24 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
| 25 |
+
with:
|
| 26 |
+
token: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
| 27 |
+
|
| 28 |
+
- name: Generate Crowdin Config
|
| 29 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 30 |
+
env:
|
| 31 |
+
PLUGIN: 'generate-config'
|
| 32 |
+
PROJECT_NAME: 'client'
|
| 33 |
+
|
| 34 |
+
##### Download Chinese #####
|
| 35 |
+
- name: Crowdin Download Chinese Translations
|
| 36 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 37 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 38 |
+
with:
|
| 39 |
+
# uploads
|
| 40 |
+
upload_sources: false
|
| 41 |
+
upload_translations: false
|
| 42 |
+
auto_approve_imported: false
|
| 43 |
+
import_eq_suggestions: false
|
| 44 |
+
|
| 45 |
+
# downloads
|
| 46 |
+
download_translations: true
|
| 47 |
+
download_language: zh-CN
|
| 48 |
+
skip_untranslated_files: false
|
| 49 |
+
export_only_approved: true
|
| 50 |
+
|
| 51 |
+
push_translations: false
|
| 52 |
+
|
| 53 |
+
# pull-request
|
| 54 |
+
create_pull_request: false
|
| 55 |
+
|
| 56 |
+
# global options
|
| 57 |
+
config: './crowdin-config.yml'
|
| 58 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 59 |
+
|
| 60 |
+
# Uncomment below to debug
|
| 61 |
+
# dryrun_action: true
|
| 62 |
+
|
| 63 |
+
# Convert Simplified Chinese to Traditional #
|
| 64 |
+
- name: Convert Chinese
|
| 65 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 66 |
+
env:
|
| 67 |
+
PLUGIN: 'convert-chinese'
|
| 68 |
+
FILE_PATHS: '["client/i18n/locales/chinese"]'
|
| 69 |
+
|
| 70 |
+
##### Download Espanol #####
|
| 71 |
+
- name: Crowdin Download Espanol Translations
|
| 72 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 73 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 74 |
+
with:
|
| 75 |
+
# uploads
|
| 76 |
+
upload_sources: false
|
| 77 |
+
upload_translations: false
|
| 78 |
+
auto_approve_imported: false
|
| 79 |
+
import_eq_suggestions: false
|
| 80 |
+
|
| 81 |
+
# downloads
|
| 82 |
+
download_translations: true
|
| 83 |
+
download_language: es-EM
|
| 84 |
+
skip_untranslated_files: false
|
| 85 |
+
export_only_approved: true
|
| 86 |
+
|
| 87 |
+
push_translations: false
|
| 88 |
+
|
| 89 |
+
# pull-request
|
| 90 |
+
create_pull_request: false
|
| 91 |
+
|
| 92 |
+
# global options
|
| 93 |
+
config: './crowdin-config.yml'
|
| 94 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 95 |
+
|
| 96 |
+
# Uncomment below to debug
|
| 97 |
+
# dryrun_action: true
|
| 98 |
+
|
| 99 |
+
##### Download Italian #####
|
| 100 |
+
- name: Crowdin Download Italian Translations
|
| 101 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 102 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 103 |
+
with:
|
| 104 |
+
# uploads
|
| 105 |
+
upload_sources: false
|
| 106 |
+
upload_translations: false
|
| 107 |
+
auto_approve_imported: false
|
| 108 |
+
import_eq_suggestions: false
|
| 109 |
+
|
| 110 |
+
# downloads
|
| 111 |
+
download_translations: true
|
| 112 |
+
download_language: it
|
| 113 |
+
skip_untranslated_files: false
|
| 114 |
+
export_only_approved: true
|
| 115 |
+
|
| 116 |
+
push_translations: false
|
| 117 |
+
|
| 118 |
+
# pull-request
|
| 119 |
+
create_pull_request: false
|
| 120 |
+
|
| 121 |
+
# global options
|
| 122 |
+
config: './crowdin-config.yml'
|
| 123 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 124 |
+
|
| 125 |
+
# Uncomment below to debug
|
| 126 |
+
# dryrun_action: true
|
| 127 |
+
|
| 128 |
+
##### Download Brazilian Portuguese #####
|
| 129 |
+
- name: Crowdin Download Portuguese (Brazilian) Translations
|
| 130 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 131 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 132 |
+
with:
|
| 133 |
+
# uploads
|
| 134 |
+
upload_sources: false
|
| 135 |
+
upload_translations: false
|
| 136 |
+
auto_approve_imported: false
|
| 137 |
+
import_eq_suggestions: false
|
| 138 |
+
|
| 139 |
+
# downloads
|
| 140 |
+
download_translations: true
|
| 141 |
+
download_language: pt-BR
|
| 142 |
+
skip_untranslated_files: false
|
| 143 |
+
export_only_approved: true
|
| 144 |
+
|
| 145 |
+
push_translations: false
|
| 146 |
+
|
| 147 |
+
# pull-request
|
| 148 |
+
create_pull_request: false
|
| 149 |
+
|
| 150 |
+
# global options
|
| 151 |
+
config: './crowdin-config.yml'
|
| 152 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 153 |
+
|
| 154 |
+
# Uncomment below to debug
|
| 155 |
+
# dryrun_action: true
|
| 156 |
+
|
| 157 |
+
##### Download Ukrainian #####
|
| 158 |
+
- name: Crowdin Download Ukrainian Translations
|
| 159 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 160 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 161 |
+
with:
|
| 162 |
+
# uploads
|
| 163 |
+
upload_sources: false
|
| 164 |
+
upload_translations: false
|
| 165 |
+
auto_approve_imported: false
|
| 166 |
+
import_eq_suggestions: false
|
| 167 |
+
|
| 168 |
+
# downloads
|
| 169 |
+
download_translations: true
|
| 170 |
+
download_language: uk
|
| 171 |
+
skip_untranslated_files: false
|
| 172 |
+
export_only_approved: true
|
| 173 |
+
|
| 174 |
+
push_translations: false
|
| 175 |
+
|
| 176 |
+
# pull-request
|
| 177 |
+
create_pull_request: false
|
| 178 |
+
|
| 179 |
+
# global options
|
| 180 |
+
config: './crowdin-config.yml'
|
| 181 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 182 |
+
|
| 183 |
+
# Uncomment below to debug
|
| 184 |
+
# dryrun_action: true
|
| 185 |
+
|
| 186 |
+
##### Download Japanese #####
|
| 187 |
+
- name: Crowdin Download Japanese Translations
|
| 188 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 189 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 190 |
+
with:
|
| 191 |
+
# uploads
|
| 192 |
+
upload_sources: false
|
| 193 |
+
upload_translations: false
|
| 194 |
+
auto_approve_imported: false
|
| 195 |
+
import_eq_suggestions: false
|
| 196 |
+
|
| 197 |
+
# downloads
|
| 198 |
+
download_translations: true
|
| 199 |
+
download_language: ja
|
| 200 |
+
skip_untranslated_files: false
|
| 201 |
+
export_only_approved: true
|
| 202 |
+
|
| 203 |
+
push_translations: false
|
| 204 |
+
|
| 205 |
+
# pull-request
|
| 206 |
+
create_pull_request: false
|
| 207 |
+
|
| 208 |
+
# global options
|
| 209 |
+
config: './crowdin-config.yml'
|
| 210 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 211 |
+
|
| 212 |
+
# Uncomment below to debug
|
| 213 |
+
# dryrun_action: true
|
| 214 |
+
|
| 215 |
+
##### Download German #####
|
| 216 |
+
- name: Crowdin Download German Translations
|
| 217 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 218 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 219 |
+
with:
|
| 220 |
+
# uploads
|
| 221 |
+
upload_sources: false
|
| 222 |
+
upload_translations: false
|
| 223 |
+
auto_approve_imported: false
|
| 224 |
+
import_eq_suggestions: false
|
| 225 |
+
|
| 226 |
+
# downloads
|
| 227 |
+
download_translations: true
|
| 228 |
+
download_language: de
|
| 229 |
+
skip_untranslated_files: false
|
| 230 |
+
export_only_approved: true
|
| 231 |
+
|
| 232 |
+
push_translations: false
|
| 233 |
+
|
| 234 |
+
# pull-request
|
| 235 |
+
create_pull_request: false
|
| 236 |
+
|
| 237 |
+
# global options
|
| 238 |
+
config: './crowdin-config.yml'
|
| 239 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 240 |
+
|
| 241 |
+
# Uncomment below to debug
|
| 242 |
+
# dryrun_action: true
|
| 243 |
+
|
| 244 |
+
##### Download Swahili #####
|
| 245 |
+
- name: Crowdin Download Swahili Translations
|
| 246 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 247 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 248 |
+
with:
|
| 249 |
+
# uploads
|
| 250 |
+
upload_sources: false
|
| 251 |
+
upload_translations: false
|
| 252 |
+
auto_approve_imported: false
|
| 253 |
+
import_eq_suggestions: false
|
| 254 |
+
|
| 255 |
+
# downloads
|
| 256 |
+
download_translations: true
|
| 257 |
+
download_language: sw
|
| 258 |
+
skip_untranslated_files: false
|
| 259 |
+
export_only_approved: true
|
| 260 |
+
|
| 261 |
+
push_translations: false
|
| 262 |
+
|
| 263 |
+
# pull-request
|
| 264 |
+
create_pull_request: false
|
| 265 |
+
|
| 266 |
+
# global options
|
| 267 |
+
config: './crowdin-config.yml'
|
| 268 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 269 |
+
|
| 270 |
+
# Uncomment below to debug
|
| 271 |
+
# dryrun_action: true
|
| 272 |
+
|
| 273 |
+
##### Download Korean #####
|
| 274 |
+
- name: Crowdin Download Korean Translations
|
| 275 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 276 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 277 |
+
with:
|
| 278 |
+
# uploads
|
| 279 |
+
upload_sources: false
|
| 280 |
+
upload_translations: false
|
| 281 |
+
auto_approve_imported: false
|
| 282 |
+
import_eq_suggestions: false
|
| 283 |
+
|
| 284 |
+
# downloads
|
| 285 |
+
download_translations: true
|
| 286 |
+
download_language: ko
|
| 287 |
+
skip_untranslated_files: false
|
| 288 |
+
export_only_approved: true
|
| 289 |
+
|
| 290 |
+
push_translations: false
|
| 291 |
+
|
| 292 |
+
# pull-request
|
| 293 |
+
create_pull_request: false
|
| 294 |
+
|
| 295 |
+
# global options
|
| 296 |
+
config: './crowdin-config.yml'
|
| 297 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 298 |
+
|
| 299 |
+
# Uncomment below to debug
|
| 300 |
+
# dryrun_action: true
|
| 301 |
+
|
| 302 |
+
###### Format JSON #####
|
| 303 |
+
# Crowdin gives the files read-only permissions, so we first have to allow
|
| 304 |
+
# writes.
|
| 305 |
+
- name: Format JSON
|
| 306 |
+
run: |
|
| 307 |
+
sudo chown -R $(whoami): client/i18n/locales
|
| 308 |
+
npx --yes prettier --write client/i18n/locales/**/*.json
|
| 309 |
+
|
| 310 |
+
###### Lowercase directory names #####
|
| 311 |
+
|
| 312 |
+
- name: Lowercase Directories
|
| 313 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 314 |
+
env:
|
| 315 |
+
PLUGIN: 'lowercase-directories'
|
| 316 |
+
FILE_PATH: 'client/i18n/locales'
|
| 317 |
+
# Crowdin translators might have the directories
|
| 318 |
+
# Create Commit
|
| 319 |
+
- name: Commit Changes
|
| 320 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 321 |
+
env:
|
| 322 |
+
PLUGIN: 'commit-changes'
|
| 323 |
+
GH_USERNAME: 'camperbot'
|
| 324 |
+
GH_EMAIL: ${{ secrets.ACTIONS_CAMPERBOT_EMAIL }}
|
| 325 |
+
GH_BRANCH: 'i18n-sync-client'
|
| 326 |
+
GH_MESSAGE: 'chore(i18n,client): processed translations'
|
| 327 |
+
|
| 328 |
+
# Generate PR #
|
| 329 |
+
# All languages should go ABOVE this. #
|
| 330 |
+
|
| 331 |
+
- name: Create PR
|
| 332 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 333 |
+
env:
|
| 334 |
+
PLUGIN: 'pull-request'
|
| 335 |
+
GH_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_PAT }}
|
| 336 |
+
BRANCH: 'i18n-sync-client'
|
| 337 |
+
REPOSITORY: 'freecodecamp/freecodecamp'
|
| 338 |
+
BASE: 'main'
|
| 339 |
+
TITLE: 'chore(i18n,client): processed translations'
|
| 340 |
+
BODY: 'This PR was opened auto-magically by Crowdin.'
|
| 341 |
+
LABELS: 'crowdin-sync'
|
| 342 |
+
TEAM_REVIEWERS: 'i18n'
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/crowdin-upload.client-ui.yml
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: i18n - Upload Client UI
|
| 2 |
+
on:
|
| 3 |
+
workflow_dispatch:
|
| 4 |
+
schedule:
|
| 5 |
+
# runs every weekday at 7:15 AM UTC
|
| 6 |
+
- cron: '15 7 * * 1-5'
|
| 7 |
+
|
| 8 |
+
env:
|
| 9 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 10 |
+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
| 11 |
+
CROWDIN_API_URL: 'https://freecodecamp.crowdin.com/api/v2/'
|
| 12 |
+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_ClIENT }}
|
| 13 |
+
|
| 14 |
+
permissions:
|
| 15 |
+
contents: read
|
| 16 |
+
|
| 17 |
+
jobs:
|
| 18 |
+
i18n-upload-client-ui-files:
|
| 19 |
+
name: Client
|
| 20 |
+
runs-on: ubuntu-24.04
|
| 21 |
+
|
| 22 |
+
steps:
|
| 23 |
+
- name: Checkout Source Files
|
| 24 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
| 25 |
+
with:
|
| 26 |
+
persist-credentials: false
|
| 27 |
+
|
| 28 |
+
- name: Generate Crowdin Config
|
| 29 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 30 |
+
env:
|
| 31 |
+
PLUGIN: 'generate-config'
|
| 32 |
+
PROJECT_NAME: 'client'
|
| 33 |
+
|
| 34 |
+
- name: Crowdin Upload
|
| 35 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 36 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 37 |
+
with:
|
| 38 |
+
# uploads
|
| 39 |
+
upload_sources: true
|
| 40 |
+
upload_translations: false
|
| 41 |
+
auto_approve_imported: false
|
| 42 |
+
import_eq_suggestions: false
|
| 43 |
+
|
| 44 |
+
# downloads
|
| 45 |
+
download_translations: false
|
| 46 |
+
|
| 47 |
+
# pull-request
|
| 48 |
+
create_pull_request: false
|
| 49 |
+
|
| 50 |
+
# global options
|
| 51 |
+
config: './crowdin-config.yml'
|
| 52 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 53 |
+
|
| 54 |
+
# Uncomment below to debug
|
| 55 |
+
# dryrun_action: true
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/crowdin-upload.curriculum.yml
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: i18n - Upload Curriculum
|
| 2 |
+
on:
|
| 3 |
+
workflow_dispatch:
|
| 4 |
+
schedule:
|
| 5 |
+
# runs every weekday at 7:30 AM UTC
|
| 6 |
+
- cron: '30 7 * * 1-5'
|
| 7 |
+
|
| 8 |
+
env:
|
| 9 |
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 10 |
+
CROWDIN_PERSONAL_TOKEN: ${{ secrets.CROWDIN_CAMPERBOT_SERVICE_TOKEN }}
|
| 11 |
+
CROWDIN_API_URL: 'https://freecodecamp.crowdin.com/api/v2/'
|
| 12 |
+
CROWDIN_PROJECT_ID: ${{ secrets.CROWDIN_PROJECT_ID_CURRICULUM }}
|
| 13 |
+
|
| 14 |
+
permissions:
|
| 15 |
+
contents: read
|
| 16 |
+
|
| 17 |
+
jobs:
|
| 18 |
+
i18n-upload-curriculum-files:
|
| 19 |
+
name: Learn
|
| 20 |
+
runs-on: ubuntu-24.04
|
| 21 |
+
|
| 22 |
+
steps:
|
| 23 |
+
- name: Checkout Source Files
|
| 24 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
| 25 |
+
with:
|
| 26 |
+
persist-credentials: false
|
| 27 |
+
|
| 28 |
+
- name: Generate Crowdin Config
|
| 29 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 30 |
+
env:
|
| 31 |
+
PLUGIN: 'generate-config'
|
| 32 |
+
PROJECT_NAME: 'curriculum'
|
| 33 |
+
|
| 34 |
+
- name: Crowdin Upload
|
| 35 |
+
uses: crowdin/github-action@c7af9bc98b01694653031fef2a0dc6c7888ce9bc # v2.17.0
|
| 36 |
+
# options: https://github.com/crowdin/github-action/blob/master/action.yml
|
| 37 |
+
with:
|
| 38 |
+
# uploads
|
| 39 |
+
upload_sources: true
|
| 40 |
+
upload_translations: false
|
| 41 |
+
auto_approve_imported: false
|
| 42 |
+
import_eq_suggestions: false
|
| 43 |
+
|
| 44 |
+
# downloads
|
| 45 |
+
download_translations: false
|
| 46 |
+
|
| 47 |
+
# pull-request
|
| 48 |
+
create_pull_request: false
|
| 49 |
+
|
| 50 |
+
# global options
|
| 51 |
+
config: './crowdin-config.yml'
|
| 52 |
+
base_url: ${{ secrets.CROWDIN_BASE_URL_FCC }}
|
| 53 |
+
|
| 54 |
+
# Uncomment below to debug
|
| 55 |
+
# dryrun_action: true
|
| 56 |
+
|
| 57 |
+
- name: Remove deleted files
|
| 58 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 59 |
+
env:
|
| 60 |
+
PLUGIN: 'remove-deleted-files'
|
| 61 |
+
FILE_PATHS: '["curriculum/challenges/english", "curriculum/dictionaries/english"]'
|
| 62 |
+
|
| 63 |
+
- name: Hide Non-Translated Strings
|
| 64 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 65 |
+
env:
|
| 66 |
+
PLUGIN: 'hide-curriculum-strings'
|
| 67 |
+
|
| 68 |
+
- name: Hide a String
|
| 69 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 70 |
+
env:
|
| 71 |
+
PLUGIN: 'hide-string'
|
| 72 |
+
FILE_NAME: 'basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md'
|
| 73 |
+
STRING_CONTENT: Here's a <a href="https://www.freecodecamp.org" target="_blank" mark="crwd-mark">link to www.freecodecamp.org</a> for you to follow.
|
| 74 |
+
|
| 75 |
+
- name: Unhide Title of Use && For a More Concise Conditional
|
| 76 |
+
uses: freecodecamp/crowdin-action@36a78cbf92f5a6c05a3a32dc8bf434a19a7c59e2 # main
|
| 77 |
+
env:
|
| 78 |
+
PLUGIN: 'unhide-string'
|
| 79 |
+
FILE_NAME: 'react/use--for-a-more-concise-conditional.md'
|
| 80 |
+
STRING_CONTENT: 'Use && for a More Concise Conditional'
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/curriculum-i18n-submodule.yml
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CI - Node.js - i18n - Submodule
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
# Run on push events, but only for the below branches
|
| 5 |
+
push:
|
| 6 |
+
branches:
|
| 7 |
+
- 'chore/update-i18n-curriculum-submodule'
|
| 8 |
+
workflow_dispatch:
|
| 9 |
+
|
| 10 |
+
permissions:
|
| 11 |
+
contents: read
|
| 12 |
+
|
| 13 |
+
jobs:
|
| 14 |
+
test-curriculum:
|
| 15 |
+
name: Test Curriculum
|
| 16 |
+
runs-on: ubuntu-24.04
|
| 17 |
+
strategy:
|
| 18 |
+
fail-fast: false
|
| 19 |
+
matrix:
|
| 20 |
+
node-version: [24]
|
| 21 |
+
# Exclude the languages that we currently run in the full CI suite.
|
| 22 |
+
locale:
|
| 23 |
+
- 'chinese'
|
| 24 |
+
- 'espanol'
|
| 25 |
+
- 'ukrainian'
|
| 26 |
+
- 'japanese'
|
| 27 |
+
- 'german'
|
| 28 |
+
- 'swahili'
|
| 29 |
+
- 'korean'
|
| 30 |
+
- 'arabic'
|
| 31 |
+
|
| 32 |
+
steps:
|
| 33 |
+
- name: Checkout
|
| 34 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 35 |
+
with:
|
| 36 |
+
submodules: 'recursive'
|
| 37 |
+
|
| 38 |
+
- name: Use Node.js ${{ matrix.node-version }}
|
| 39 |
+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
| 40 |
+
with:
|
| 41 |
+
node-version: ${{ matrix.node-version }}
|
| 42 |
+
|
| 43 |
+
- name: Install pnpm
|
| 44 |
+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
| 45 |
+
id: pnpm-install
|
| 46 |
+
with:
|
| 47 |
+
run_install: false
|
| 48 |
+
|
| 49 |
+
- name: Setup Turbo Cache
|
| 50 |
+
uses: ./.github/actions/setup-turbo-cache
|
| 51 |
+
with:
|
| 52 |
+
turbo-token: ${{ secrets.TURBO_TOKEN }}
|
| 53 |
+
turbo-signature-key: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
|
| 54 |
+
|
| 55 |
+
- name: Set Environment variables
|
| 56 |
+
run: |
|
| 57 |
+
sed '/^[[:space:]]*#/d; /^$/d' sample.env >> $GITHUB_ENV
|
| 58 |
+
|
| 59 |
+
- name: Install node_modules
|
| 60 |
+
run: pnpm install
|
| 61 |
+
|
| 62 |
+
# DONT REMOVE THIS STEP.
|
| 63 |
+
# TODO: Refactor and use re-usable workflow and shared artifacts
|
| 64 |
+
- name: Build Client in ${{ matrix.locale }}
|
| 65 |
+
env:
|
| 66 |
+
CURRICULUM_LOCALE: ${{ matrix.locale }}
|
| 67 |
+
CLIENT_LOCALE: ${{ matrix.locale }}
|
| 68 |
+
run: |
|
| 69 |
+
pnpm run build
|
| 70 |
+
|
| 71 |
+
- name: Install Chrome for Puppeteer
|
| 72 |
+
run: pnpm -F=curriculum install-puppeteer
|
| 73 |
+
|
| 74 |
+
- name: Run Tests
|
| 75 |
+
env:
|
| 76 |
+
CURRICULUM_LOCALE: ${{ matrix.locale }}
|
| 77 |
+
CLIENT_LOCALE: ${{ matrix.locale }}
|
| 78 |
+
run: pnpm -F=curriculum test-content
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/deploy-api.yml
ADDED
|
@@ -0,0 +1,353 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CD - Deploy - API
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch:
|
| 5 |
+
inputs:
|
| 6 |
+
api_log_lvl:
|
| 7 |
+
description: 'Log level for the API'
|
| 8 |
+
type: choice
|
| 9 |
+
options:
|
| 10 |
+
- debug
|
| 11 |
+
- info
|
| 12 |
+
- warn
|
| 13 |
+
default: debug
|
| 14 |
+
show_upcoming_changes:
|
| 15 |
+
description: 'Show upcoming changes (enables upcoming certifications and challenges)'
|
| 16 |
+
type: boolean
|
| 17 |
+
default: false
|
| 18 |
+
dump_stack_config:
|
| 19 |
+
description: 'Dump the docker stack config'
|
| 20 |
+
type: boolean
|
| 21 |
+
default: false
|
| 22 |
+
|
| 23 |
+
concurrency:
|
| 24 |
+
group: deploy-api-${{ github.ref_name }}
|
| 25 |
+
cancel-in-progress: false
|
| 26 |
+
|
| 27 |
+
jobs:
|
| 28 |
+
setup-jobs:
|
| 29 |
+
name: Setup Jobs
|
| 30 |
+
runs-on: ubuntu-24.04
|
| 31 |
+
outputs:
|
| 32 |
+
site_tld: ${{ steps.setup.outputs.site_tld }}
|
| 33 |
+
tgt_env_short: ${{ steps.setup.outputs.tgt_env_short }}
|
| 34 |
+
tgt_env_long: ${{ steps.setup.outputs.tgt_env_long }}
|
| 35 |
+
api_log_lvl: ${{ steps.setup.outputs.api_log_lvl }}
|
| 36 |
+
show_upcoming_changes: ${{ steps.setup.outputs.show_upcoming_changes }}
|
| 37 |
+
dump_stack_config: ${{ steps.setup.outputs.dump_stack_config }}
|
| 38 |
+
steps:
|
| 39 |
+
- name: Setup
|
| 40 |
+
id: setup
|
| 41 |
+
env:
|
| 42 |
+
BRANCH: ${{ github.ref_name }}
|
| 43 |
+
SHOW_UPCOMING_CHANGES: ${{ inputs.show_upcoming_changes }}
|
| 44 |
+
API_LOG_LVL: ${{ inputs.api_log_lvl || 'debug' }}
|
| 45 |
+
DUMP_STACK_CONFIG: ${{ inputs.dump_stack_config }}
|
| 46 |
+
run: |
|
| 47 |
+
echo "Current branch: $BRANCH"
|
| 48 |
+
|
| 49 |
+
# Convert boolean input to string 'true' or 'false'
|
| 50 |
+
if [[ "$SHOW_UPCOMING_CHANGES" == "true" ]]; then
|
| 51 |
+
echo "show_upcoming_changes=true" >> "$GITHUB_OUTPUT"
|
| 52 |
+
else
|
| 53 |
+
echo "show_upcoming_changes=false" >> "$GITHUB_OUTPUT"
|
| 54 |
+
fi
|
| 55 |
+
|
| 56 |
+
# Convert boolean input to string 'true' or 'false'
|
| 57 |
+
if [[ "$DUMP_STACK_CONFIG" == "true" ]]; then
|
| 58 |
+
echo "dump_stack_config=true" >> "$GITHUB_OUTPUT"
|
| 59 |
+
else
|
| 60 |
+
echo "dump_stack_config=false" >> "$GITHUB_OUTPUT"
|
| 61 |
+
fi
|
| 62 |
+
|
| 63 |
+
case "$BRANCH" in
|
| 64 |
+
"prod-current")
|
| 65 |
+
echo "site_tld=org" >> "$GITHUB_OUTPUT"
|
| 66 |
+
echo "tgt_env_short=prd" >> "$GITHUB_OUTPUT"
|
| 67 |
+
echo "tgt_env_long=production" >> "$GITHUB_OUTPUT"
|
| 68 |
+
echo "api_log_lvl=$API_LOG_LVL" >> "$GITHUB_OUTPUT"
|
| 69 |
+
;;
|
| 70 |
+
*)
|
| 71 |
+
echo "site_tld=dev" >> "$GITHUB_OUTPUT"
|
| 72 |
+
echo "tgt_env_short=stg" >> "$GITHUB_OUTPUT"
|
| 73 |
+
echo "tgt_env_long=staging" >> "$GITHUB_OUTPUT"
|
| 74 |
+
echo "api_log_lvl=$API_LOG_LVL" >> "$GITHUB_OUTPUT"
|
| 75 |
+
;;
|
| 76 |
+
esac
|
| 77 |
+
|
| 78 |
+
build:
|
| 79 |
+
name: Build & Push
|
| 80 |
+
needs: setup-jobs
|
| 81 |
+
uses: ./.github/workflows/docker-docr.yml
|
| 82 |
+
with:
|
| 83 |
+
site_tld: ${{ needs.setup-jobs.outputs.site_tld }}
|
| 84 |
+
app: api
|
| 85 |
+
show_upcoming_changes: ${{ needs.setup-jobs.outputs.show_upcoming_changes }}
|
| 86 |
+
secrets:
|
| 87 |
+
DIGITALOCEAN_ACCESS_TOKEN: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
| 88 |
+
DOCR_NAME: ${{ secrets.DOCR_NAME }}
|
| 89 |
+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
| 90 |
+
|
| 91 |
+
deploy:
|
| 92 |
+
name: Deploy to Docker Swarm -- ${{ needs.setup-jobs.outputs.tgt_env_short }}
|
| 93 |
+
runs-on: ubuntu-24.04
|
| 94 |
+
needs: [setup-jobs, build]
|
| 95 |
+
env:
|
| 96 |
+
TS_USERNAME: ${{ secrets.TS_USERNAME }}
|
| 97 |
+
TS_MACHINE_NAME: ${{ secrets.TS_MACHINE_NAME }}
|
| 98 |
+
permissions:
|
| 99 |
+
deployments: write
|
| 100 |
+
environment:
|
| 101 |
+
name: ${{ needs.setup-jobs.outputs.tgt_env_short }}-api
|
| 102 |
+
|
| 103 |
+
steps:
|
| 104 |
+
- name: Setup and connect to Tailscale network
|
| 105 |
+
uses: tailscale/github-action@306e68a486fd2350f2bfc3b19fcd143891a4a2d8 # v4
|
| 106 |
+
with:
|
| 107 |
+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
|
| 108 |
+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
|
| 109 |
+
hostname: gha-${{needs.setup-jobs.outputs.tgt_env_short}}-api-ci-${{ github.run_id }}
|
| 110 |
+
tags: tag:ci
|
| 111 |
+
version: latest
|
| 112 |
+
|
| 113 |
+
- name: Wait for Tailscale Network Readiness
|
| 114 |
+
run: |
|
| 115 |
+
echo "Waiting for Tailscale network to be ready..."
|
| 116 |
+
max_wait=60
|
| 117 |
+
elapsed=0
|
| 118 |
+
|
| 119 |
+
while [ $elapsed -lt $max_wait ]; do
|
| 120 |
+
if tailscale status --json | jq -e '.BackendState == "Running"' > /dev/null 2>&1; then
|
| 121 |
+
echo "Tailscale network is ready"
|
| 122 |
+
break
|
| 123 |
+
fi
|
| 124 |
+
sleep 2
|
| 125 |
+
elapsed=$((elapsed + 2))
|
| 126 |
+
done
|
| 127 |
+
|
| 128 |
+
if [ $elapsed -ge $max_wait ]; then
|
| 129 |
+
echo "Tailscale network not ready after ${max_wait}s"
|
| 130 |
+
exit 1
|
| 131 |
+
fi
|
| 132 |
+
|
| 133 |
+
- name: Configure SSH & Check Connection
|
| 134 |
+
run: |
|
| 135 |
+
mkdir -p ~/.ssh
|
| 136 |
+
echo "Host *
|
| 137 |
+
UserKnownHostsFile=/dev/null
|
| 138 |
+
StrictHostKeyChecking no" > ~/.ssh/config
|
| 139 |
+
chmod 644 ~/.ssh/config
|
| 140 |
+
|
| 141 |
+
scrub_ips() {
|
| 142 |
+
sed -E 's/100(\.[0-9]{1,3}){3}/100.x.x.x/g'
|
| 143 |
+
}
|
| 144 |
+
|
| 145 |
+
validate_connection() {
|
| 146 |
+
local machine_name=$1
|
| 147 |
+
local max_retries=3
|
| 148 |
+
local retry_delay=5
|
| 149 |
+
local ping_output ssh_output
|
| 150 |
+
|
| 151 |
+
for attempt in $(seq 1 $max_retries); do
|
| 152 |
+
echo "Connection attempt $attempt/$max_retries to $machine_name"
|
| 153 |
+
|
| 154 |
+
if ! ping_output=$(tailscale ping -c 1 --until-direct=false --timeout=5s "$machine_name" 2>&1); then
|
| 155 |
+
ping_output=$(printf '%s' "$ping_output" | scrub_ips)
|
| 156 |
+
echo "No Tailscale data path to $machine_name: $ping_output"
|
| 157 |
+
if [ "$attempt" -eq "$max_retries" ]; then
|
| 158 |
+
return 1
|
| 159 |
+
fi
|
| 160 |
+
sleep "$retry_delay"
|
| 161 |
+
continue
|
| 162 |
+
fi
|
| 163 |
+
|
| 164 |
+
MACHINE_IP=$(tailscale ip -4 "$machine_name")
|
| 165 |
+
if ssh_output=$(ssh -o ConnectTimeout=10 -o BatchMode=yes "$TS_USERNAME@$MACHINE_IP" "echo 'Connection test'; docker --version" 2>&1); then
|
| 166 |
+
echo "Successfully validated connection to $machine_name"
|
| 167 |
+
return 0
|
| 168 |
+
fi
|
| 169 |
+
|
| 170 |
+
ssh_output=$(printf '%s' "$ssh_output" | scrub_ips)
|
| 171 |
+
echo "SSH validation failed for $machine_name: $ssh_output"
|
| 172 |
+
if [ "$attempt" -lt "$max_retries" ]; then
|
| 173 |
+
sleep "$retry_delay"
|
| 174 |
+
fi
|
| 175 |
+
done
|
| 176 |
+
|
| 177 |
+
echo "Failed to establish connection to $machine_name after $max_retries attempts"
|
| 178 |
+
return 1
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
echo -e "\nLOG:Validating connection to $TS_MACHINE_NAME..."
|
| 182 |
+
if ! validate_connection "$TS_MACHINE_NAME"; then
|
| 183 |
+
echo "Error: Failed to establish reliable connection to $TS_MACHINE_NAME"
|
| 184 |
+
exit 1
|
| 185 |
+
fi
|
| 186 |
+
|
| 187 |
+
- name: Deploy with Docker Stack
|
| 188 |
+
env:
|
| 189 |
+
AGE_ENCRYPTED_ASC_SECRETS: ${{ secrets.AGE_ENCRYPTED_ASC_SECRETS }}
|
| 190 |
+
AGE_SECRET_KEY: ${{ secrets.AGE_SECRET_KEY }}
|
| 191 |
+
# Variable set from GitHub "Environment" secrets (AGE encrypted)
|
| 192 |
+
# DOCKER_REGISTRY
|
| 193 |
+
# MONGOHQ_URL
|
| 194 |
+
# SENTRY_DSN
|
| 195 |
+
# SENTRY_ENVIRONMENT
|
| 196 |
+
# AUTH0_CLIENT_ID
|
| 197 |
+
# AUTH0_CLIENT_SECRET
|
| 198 |
+
# AUTH0_DOMAIN
|
| 199 |
+
# JWT_SECRET
|
| 200 |
+
# COOKIE_SECRET
|
| 201 |
+
# COOKIE_DOMAIN
|
| 202 |
+
# SES_ID
|
| 203 |
+
# SES_SECRET
|
| 204 |
+
# SES_SMTP_USERNAME
|
| 205 |
+
# SES_SMTP_PASSWORD
|
| 206 |
+
# GROWTHBOOK_FASTIFY_API_HOST
|
| 207 |
+
# GROWTHBOOK_FASTIFY_CLIENT_KEY
|
| 208 |
+
# HOME_LOCATION
|
| 209 |
+
# API_LOCATION
|
| 210 |
+
# SOCRATES_API_KEY
|
| 211 |
+
# SOCRATES_ENDPOINT
|
| 212 |
+
# STRIPE_SECRET_KEY
|
| 213 |
+
# Variables set from SetupJob
|
| 214 |
+
DEPLOYMENT_VERSION: ${{ needs.build.outputs.tagname }}
|
| 215 |
+
DEPLOYMENT_ENV: ${{ needs.setup-jobs.outputs.tgt_env_long }}
|
| 216 |
+
DEPLOYMENT_TLD: ${{ needs.setup-jobs.outputs.site_tld }}
|
| 217 |
+
FCC_API_LOG_LEVEL: ${{ needs.setup-jobs.outputs.api_log_lvl }}
|
| 218 |
+
SHOW_UPCOMING_CHANGES: ${{ needs.setup-jobs.outputs.show_upcoming_changes }}
|
| 219 |
+
DUMP_STACK_CONFIG: ${{ needs.setup-jobs.outputs.dump_stack_config }}
|
| 220 |
+
# Stack name
|
| 221 |
+
STACK_NAME: ${{ needs.setup-jobs.outputs.tgt_env_short }}-api
|
| 222 |
+
run: |
|
| 223 |
+
REMOTE_SCRIPT="
|
| 224 |
+
set -e
|
| 225 |
+
trap 'rm -f .env age.key secrets.age.asc .env.tmp' EXIT
|
| 226 |
+
echo -e '\nLOG:Deploying API to $TS_MACHINE_NAME...'
|
| 227 |
+
cd /home/$TS_USERNAME/docker-swarm-config/stacks/api
|
| 228 |
+
|
| 229 |
+
echo -e '\nLOG:Checking if age is installed...'
|
| 230 |
+
which age > /dev/null
|
| 231 |
+
|
| 232 |
+
echo -e '\nLOG:Decrypting secrets...'
|
| 233 |
+
echo \"$AGE_ENCRYPTED_ASC_SECRETS\" > secrets.age.asc
|
| 234 |
+
echo \"$AGE_SECRET_KEY\" > age.key && chmod 600 age.key
|
| 235 |
+
age --identity age.key --decrypt secrets.age.asc > .env
|
| 236 |
+
rm -f age.key secrets.age.asc
|
| 237 |
+
|
| 238 |
+
echo -e '\nLOG:Cleaning up .env file...'
|
| 239 |
+
touch .env.tmp
|
| 240 |
+
while IFS= read -r line; do
|
| 241 |
+
if [[ \$line =~ ^[A-Za-z0-9_]+=.*$ ]]; then
|
| 242 |
+
# Extract the key (part before the first =)
|
| 243 |
+
key=\${line%%=*}
|
| 244 |
+
# Remove any previous line with this key
|
| 245 |
+
sed -i \"/^\${key}=/d\" .env.tmp
|
| 246 |
+
fi
|
| 247 |
+
# Append the current line
|
| 248 |
+
echo \"\$line\" >> .env.tmp
|
| 249 |
+
done < .env
|
| 250 |
+
mv .env.tmp .env
|
| 251 |
+
|
| 252 |
+
echo -e '\nLOG:Adding deployment variables...'
|
| 253 |
+
{
|
| 254 |
+
echo \"DEPLOYMENT_VERSION=$DEPLOYMENT_VERSION\"
|
| 255 |
+
echo \"DEPLOYMENT_TLD=$DEPLOYMENT_TLD\"
|
| 256 |
+
echo \"DEPLOYMENT_ENV=$DEPLOYMENT_ENV\"
|
| 257 |
+
echo \"FCC_API_LOG_LEVEL=$FCC_API_LOG_LEVEL\"
|
| 258 |
+
echo \"SHOW_UPCOMING_CHANGES=$SHOW_UPCOMING_CHANGES\"
|
| 259 |
+
} >> .env
|
| 260 |
+
|
| 261 |
+
echo -e '\nLOG:Sourcing environment...'
|
| 262 |
+
REQUIRED_VARS=(
|
| 263 |
+
\"DOCKER_REGISTRY\"
|
| 264 |
+
\"MONGOHQ_URL\"
|
| 265 |
+
\"SENTRY_DSN\"
|
| 266 |
+
\"SENTRY_ENVIRONMENT\"
|
| 267 |
+
\"AUTH0_CLIENT_ID\"
|
| 268 |
+
\"AUTH0_CLIENT_SECRET\"
|
| 269 |
+
\"AUTH0_DOMAIN\"
|
| 270 |
+
\"JWT_SECRET\"
|
| 271 |
+
\"COOKIE_SECRET\"
|
| 272 |
+
\"COOKIE_DOMAIN\"
|
| 273 |
+
\"SES_ID\"
|
| 274 |
+
\"SES_SECRET\"
|
| 275 |
+
\"SES_SMTP_USERNAME\"
|
| 276 |
+
\"SES_SMTP_PASSWORD\"
|
| 277 |
+
\"GROWTHBOOK_FASTIFY_API_HOST\"
|
| 278 |
+
\"GROWTHBOOK_FASTIFY_CLIENT_KEY\"
|
| 279 |
+
\"HOME_LOCATION\"
|
| 280 |
+
\"API_LOCATION\"
|
| 281 |
+
\"SOCRATES_API_KEY\"
|
| 282 |
+
\"SOCRATES_ENDPOINT\"
|
| 283 |
+
\"STRIPE_SECRET_KEY\"
|
| 284 |
+
\"DEPLOYMENT_VERSION\"
|
| 285 |
+
\"DEPLOYMENT_TLD\"
|
| 286 |
+
\"DEPLOYMENT_ENV\"
|
| 287 |
+
\"FCC_API_LOG_LEVEL\"
|
| 288 |
+
)
|
| 289 |
+
|
| 290 |
+
while IFS='=' read -r key value; do
|
| 291 |
+
if [[ -n \"\$key\" && ! \"\$key\" =~ ^# ]]; then
|
| 292 |
+
export \"\${key}=\${value}\"
|
| 293 |
+
fi
|
| 294 |
+
done < .env
|
| 295 |
+
|
| 296 |
+
MISSING_VARS=()
|
| 297 |
+
for var in \"\${REQUIRED_VARS[@]}\"; do
|
| 298 |
+
if [[ -z \"\${!var}\" ]]; then
|
| 299 |
+
MISSING_VARS+=(\"\$var\")
|
| 300 |
+
fi
|
| 301 |
+
done
|
| 302 |
+
|
| 303 |
+
if [[ \${#MISSING_VARS[@]} -gt 0 ]]; then
|
| 304 |
+
echo \"ERROR: The following required environment variables are missing or empty:\"
|
| 305 |
+
for var in \"\${MISSING_VARS[@]}\"; do
|
| 306 |
+
echo \" - \$var\"
|
| 307 |
+
done
|
| 308 |
+
exit 1
|
| 309 |
+
fi
|
| 310 |
+
|
| 311 |
+
rm -rf .env
|
| 312 |
+
|
| 313 |
+
echo -e '\nLOG:Validating deployment version...'
|
| 314 |
+
if [[ \"\$DEPLOYMENT_VERSION\" != \"$DEPLOYMENT_VERSION\" ]]; then
|
| 315 |
+
echo \"Error: Version mismatch. Expected: $DEPLOYMENT_VERSION, Got: \$DEPLOYMENT_VERSION\"
|
| 316 |
+
exit 1
|
| 317 |
+
fi
|
| 318 |
+
env | grep -E 'DEPLOYMENT_VERSION'
|
| 319 |
+
|
| 320 |
+
echo -e '\nLOG:Checking stack configuration...'
|
| 321 |
+
CONFIG_OUTPUT=\"/dev/null\"
|
| 322 |
+
if [[ \"$DUMP_STACK_CONFIG\" == \"true\" ]]; then
|
| 323 |
+
CONFIG_FILENAME=\"docker-stack-config-\${DEPLOYMENT_VERSION}.yml\"
|
| 324 |
+
echo -e '\nLOG:Saving stack configuration for debugging...'
|
| 325 |
+
CONFIG_OUTPUT=\"\$CONFIG_FILENAME\"
|
| 326 |
+
fi
|
| 327 |
+
docker stack config -c stack-api.yml > \$CONFIG_OUTPUT
|
| 328 |
+
|
| 329 |
+
echo -e '\nLOG:Deploying stack...'
|
| 330 |
+
docker stack deploy -c stack-api.yml --prune --with-registry-auth --detach=false $STACK_NAME
|
| 331 |
+
|
| 332 |
+
echo -e '\nLOG:Finished deployment.'
|
| 333 |
+
"
|
| 334 |
+
MACHINE_IP=$(tailscale ip -4 "$TS_MACHINE_NAME")
|
| 335 |
+
# shellcheck disable=SC2029 # client-side expansion of REMOTE_SCRIPT is intended
|
| 336 |
+
ssh "$TS_USERNAME@$MACHINE_IP" "$REMOTE_SCRIPT"
|
| 337 |
+
|
| 338 |
+
# TODO(o11y): Sentry release finalize disabled pending a follow-up PR with
|
| 339 |
+
# a stable release-id scheme (source-map upload in docker-docr.yml is
|
| 340 |
+
# disabled alongside). Re-enabling should also gate on a rollback-safe
|
| 341 |
+
# convergence check (docker service state) before finalizing, since
|
| 342 |
+
# `docker stack deploy --detach=false` exits 0 through a healthcheck
|
| 343 |
+
# rollback. See .scratchpad/o11y-cutover-review-2026-07-10.md.
|
| 344 |
+
# - name: Finalize Sentry release
|
| 345 |
+
# env:
|
| 346 |
+
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
| 347 |
+
# SENTRY_ORG: freecodecamp
|
| 348 |
+
# SENTRY_PROJECT: api-fastify
|
| 349 |
+
# RELEASE: ${{ needs.build.outputs.tagname }}
|
| 350 |
+
# DEPLOY_ENV: ${{ needs.setup-jobs.outputs.tgt_env_long }}
|
| 351 |
+
# run: |
|
| 352 |
+
# npx --yes @sentry/cli@3.6.0 releases finalize "$RELEASE"
|
| 353 |
+
# npx --yes @sentry/cli@3.6.0 releases deploys "$RELEASE" new -e "$DEPLOY_ENV"
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/deploy-client.yml
ADDED
|
@@ -0,0 +1,393 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CD - Deploy - Clients
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch:
|
| 5 |
+
inputs:
|
| 6 |
+
target_language:
|
| 7 |
+
description: 'Target language (or "all" for all languages)'
|
| 8 |
+
type: choice
|
| 9 |
+
options:
|
| 10 |
+
- all
|
| 11 |
+
- english
|
| 12 |
+
- chinese
|
| 13 |
+
- espanol
|
| 14 |
+
- chinese-traditional
|
| 15 |
+
- italian
|
| 16 |
+
- portuguese
|
| 17 |
+
- ukrainian
|
| 18 |
+
- japanese
|
| 19 |
+
- german
|
| 20 |
+
- swahili
|
| 21 |
+
- korean
|
| 22 |
+
- arabic
|
| 23 |
+
default: all
|
| 24 |
+
show_upcoming_changes:
|
| 25 |
+
description: 'Show upcoming changes (enables upcoming certifications and challenges)'
|
| 26 |
+
type: boolean
|
| 27 |
+
default: false
|
| 28 |
+
|
| 29 |
+
concurrency:
|
| 30 |
+
group: deploy-client-${{ github.ref_name }}
|
| 31 |
+
cancel-in-progress: false
|
| 32 |
+
|
| 33 |
+
jobs:
|
| 34 |
+
setup-jobs:
|
| 35 |
+
name: Setup Jobs
|
| 36 |
+
runs-on: ubuntu-24.04
|
| 37 |
+
outputs:
|
| 38 |
+
site_tld: ${{ steps.setup.outputs.site_tld }} # org, dev
|
| 39 |
+
tgt_env_short: ${{ steps.setup.outputs.tgt_env_short }} # prd, stg
|
| 40 |
+
tgt_env_long: ${{ steps.setup.outputs.tgt_env_long }} # production, staging
|
| 41 |
+
tgt_env_branch: ${{ steps.setup.outputs.tgt_env_branch }} # prod-current, prod-staging
|
| 42 |
+
show_upcoming_changes: ${{ steps.setup.outputs.show_upcoming_changes }}
|
| 43 |
+
steps:
|
| 44 |
+
- name: Setup
|
| 45 |
+
id: setup
|
| 46 |
+
env:
|
| 47 |
+
BRANCH: ${{ github.ref_name }}
|
| 48 |
+
SHOW_UPCOMING_CHANGES: ${{ inputs.show_upcoming_changes }}
|
| 49 |
+
run: |
|
| 50 |
+
echo "Current branch: $BRANCH"
|
| 51 |
+
|
| 52 |
+
# Convert boolean input to string 'true' or 'false'
|
| 53 |
+
if [[ "$SHOW_UPCOMING_CHANGES" == "true" ]]; then
|
| 54 |
+
echo "show_upcoming_changes=true" >> $GITHUB_OUTPUT
|
| 55 |
+
else
|
| 56 |
+
echo "show_upcoming_changes=false" >> $GITHUB_OUTPUT
|
| 57 |
+
fi
|
| 58 |
+
|
| 59 |
+
case "$BRANCH" in
|
| 60 |
+
"prod-current")
|
| 61 |
+
echo "site_tld=org" >> $GITHUB_OUTPUT
|
| 62 |
+
echo "tgt_env_short=prd" >> $GITHUB_OUTPUT
|
| 63 |
+
echo "tgt_env_long=production" >> $GITHUB_OUTPUT
|
| 64 |
+
echo "tgt_env_branch=prod-current" >> $GITHUB_OUTPUT
|
| 65 |
+
;;
|
| 66 |
+
*)
|
| 67 |
+
echo "site_tld=dev" >> $GITHUB_OUTPUT
|
| 68 |
+
echo "tgt_env_short=stg" >> $GITHUB_OUTPUT
|
| 69 |
+
echo "tgt_env_long=staging" >> $GITHUB_OUTPUT
|
| 70 |
+
echo "tgt_env_branch=prod-staging" >> $GITHUB_OUTPUT
|
| 71 |
+
;;
|
| 72 |
+
esac
|
| 73 |
+
|
| 74 |
+
setup-matrix:
|
| 75 |
+
name: Setup Matrix
|
| 76 |
+
runs-on: ubuntu-24.04
|
| 77 |
+
needs: setup-jobs
|
| 78 |
+
outputs:
|
| 79 |
+
matrix: ${{ steps.matrix.outputs.matrix }}
|
| 80 |
+
steps:
|
| 81 |
+
- name: Setup Matrix
|
| 82 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 83 |
+
id: matrix
|
| 84 |
+
env:
|
| 85 |
+
TARGET_LANG: ${{ inputs.target_language }}
|
| 86 |
+
with:
|
| 87 |
+
script: |
|
| 88 |
+
// Constants
|
| 89 |
+
const NODE_VERSION = 24;
|
| 90 |
+
|
| 91 |
+
// Input sanitization and validation
|
| 92 |
+
const rawTargetLang = process.env.TARGET_LANG || 'all';
|
| 93 |
+
const targetLang = rawTargetLang.trim().toLowerCase();
|
| 94 |
+
console.log(`Target language: ${targetLang}`);
|
| 95 |
+
|
| 96 |
+
// Language mappings (single source of truth)
|
| 97 |
+
const languageMap = {
|
| 98 |
+
'english': 'eng',
|
| 99 |
+
'chinese': 'chn',
|
| 100 |
+
'espanol': 'esp',
|
| 101 |
+
'chinese-traditional': 'cnt',
|
| 102 |
+
'italian': 'ita',
|
| 103 |
+
'portuguese': 'por',
|
| 104 |
+
'ukrainian': 'ukr',
|
| 105 |
+
'japanese': 'jpn',
|
| 106 |
+
'german': 'ger',
|
| 107 |
+
'swahili': 'swa',
|
| 108 |
+
'korean': 'kor',
|
| 109 |
+
'arabic': 'ara'
|
| 110 |
+
};
|
| 111 |
+
|
| 112 |
+
const allLanguages = Object.keys(languageMap);
|
| 113 |
+
let matrix;
|
| 114 |
+
|
| 115 |
+
if (targetLang === 'all') {
|
| 116 |
+
console.log('Building matrix for all languages');
|
| 117 |
+
console.log(`Available languages: ${allLanguages.join(', ')}`);
|
| 118 |
+
|
| 119 |
+
// Build include array for all languages
|
| 120 |
+
const include = allLanguages.map(lang => ({
|
| 121 |
+
'node-version': NODE_VERSION,
|
| 122 |
+
'lang-name-full': lang,
|
| 123 |
+
'lang-name-short': languageMap[lang]
|
| 124 |
+
}));
|
| 125 |
+
|
| 126 |
+
matrix = {
|
| 127 |
+
include: include
|
| 128 |
+
};
|
| 129 |
+
|
| 130 |
+
} else {
|
| 131 |
+
console.log(`Building matrix for single language: ${targetLang}`);
|
| 132 |
+
|
| 133 |
+
// Validate language selection
|
| 134 |
+
if (!languageMap[targetLang]) {
|
| 135 |
+
const errorMsg = `Unknown language '${targetLang}'. Available: ${allLanguages.join(', ')}`;
|
| 136 |
+
console.error(errorMsg);
|
| 137 |
+
core.setFailed(errorMsg);
|
| 138 |
+
return;
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
console.log(`Processing: ${targetLang} -> ${languageMap[targetLang]}`);
|
| 142 |
+
|
| 143 |
+
// Create single language matrix
|
| 144 |
+
matrix = {
|
| 145 |
+
include: [{
|
| 146 |
+
'node-version': NODE_VERSION,
|
| 147 |
+
'lang-name-full': targetLang,
|
| 148 |
+
'lang-name-short': languageMap[targetLang]
|
| 149 |
+
}]
|
| 150 |
+
};
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
// Final validation
|
| 154 |
+
if (!matrix || !matrix.include || matrix.include.length === 0) {
|
| 155 |
+
core.setFailed('Generated matrix is empty or invalid');
|
| 156 |
+
return;
|
| 157 |
+
}
|
| 158 |
+
|
| 159 |
+
console.log('Generated matrix:');
|
| 160 |
+
console.log(JSON.stringify(matrix, null, 2));
|
| 161 |
+
console.log(`Matrix will create ${matrix.include.length} job(s)`);
|
| 162 |
+
|
| 163 |
+
// Set output for GitHub Actions
|
| 164 |
+
core.setOutput('matrix', JSON.stringify(matrix));
|
| 165 |
+
|
| 166 |
+
client:
|
| 167 |
+
name: Clients - [${{ needs.setup-jobs.outputs.tgt_env_short }}] [${{ matrix.lang-name-short }}]
|
| 168 |
+
needs: [setup-jobs, setup-matrix]
|
| 169 |
+
runs-on: ubuntu-24.04
|
| 170 |
+
strategy:
|
| 171 |
+
fail-fast: false
|
| 172 |
+
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
|
| 173 |
+
permissions:
|
| 174 |
+
deployments: write
|
| 175 |
+
contents: read
|
| 176 |
+
environment:
|
| 177 |
+
name: ${{ needs.setup-jobs.outputs.tgt_env_short }}-clients
|
| 178 |
+
env:
|
| 179 |
+
TS_USERNAME: ${{ secrets.TS_USERNAME }}
|
| 180 |
+
TS_MACHINE_NAME_PREFIX: ${{ secrets.TS_MACHINE_NAME_PREFIX }}
|
| 181 |
+
|
| 182 |
+
steps:
|
| 183 |
+
- name: Checkout
|
| 184 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 185 |
+
with:
|
| 186 |
+
submodules: 'recursive'
|
| 187 |
+
|
| 188 |
+
- name: Use Node.js ${{ matrix.node-version }}
|
| 189 |
+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
| 190 |
+
with:
|
| 191 |
+
node-version: ${{ matrix.node-version }}
|
| 192 |
+
|
| 193 |
+
- name: Install pnpm
|
| 194 |
+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
| 195 |
+
id: pnpm-install
|
| 196 |
+
with:
|
| 197 |
+
run_install: false
|
| 198 |
+
|
| 199 |
+
- name: Language specific ENV - [${{ matrix.lang-name-full }}]
|
| 200 |
+
run: |
|
| 201 |
+
if [ "${{ matrix.lang-name-full }}" = "english" ]; then
|
| 202 |
+
echo "HOME_LOCATION=https://www.freecodecamp.${{ needs.setup-jobs.outputs.site_tld }}" >> $GITHUB_ENV
|
| 203 |
+
echo "NEWS_LOCATION=https://www.freecodecamp.${{ needs.setup-jobs.outputs.site_tld }}/news" >> $GITHUB_ENV
|
| 204 |
+
else
|
| 205 |
+
echo "HOME_LOCATION=https://www.freecodecamp.${{ needs.setup-jobs.outputs.site_tld }}/${{ matrix.lang-name-full }}" >> $GITHUB_ENV
|
| 206 |
+
echo "NEWS_LOCATION=https://www.freecodecamp.${{ needs.setup-jobs.outputs.site_tld }}/${{ matrix.lang-name-full }}/news" >> $GITHUB_ENV
|
| 207 |
+
fi
|
| 208 |
+
echo "CLIENT_LOCALE=${{ matrix.lang-name-full }}" >> $GITHUB_ENV
|
| 209 |
+
echo "CURRICULUM_LOCALE=${{ matrix.lang-name-full }}" >> $GITHUB_ENV
|
| 210 |
+
|
| 211 |
+
- name: Create deployment version
|
| 212 |
+
id: deployment-version
|
| 213 |
+
run: |
|
| 214 |
+
DEPLOYMENT_VERSION=$(git rev-parse --short HEAD)-$(date +%Y%m%d)-$(date +%H%M)
|
| 215 |
+
echo "DEPLOYMENT_VERSION=$DEPLOYMENT_VERSION" >> $GITHUB_ENV
|
| 216 |
+
echo "DEPLOYMENT_VERSION=$DEPLOYMENT_VERSION" >> $GITHUB_OUTPUT
|
| 217 |
+
|
| 218 |
+
- name: Install and Build
|
| 219 |
+
env:
|
| 220 |
+
API_LOCATION: 'https://api.freecodecamp.${{ needs.setup-jobs.outputs.site_tld }}'
|
| 221 |
+
ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
|
| 222 |
+
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
|
| 223 |
+
GROWTHBOOK_URI: ${{ secrets.GROWTHBOOK_URI }}
|
| 224 |
+
FORUM_LOCATION: 'https://forum.freecodecamp.org'
|
| 225 |
+
PATREON_CLIENT_ID: ${{ secrets.PATREON_CLIENT_ID }}
|
| 226 |
+
PAYPAL_CLIENT_ID: ${{ secrets.PAYPAL_CLIENT_ID }}
|
| 227 |
+
STRIPE_PUBLIC_KEY: ${{ secrets.STRIPE_PUBLIC_KEY }}
|
| 228 |
+
SHOW_UPCOMING_CHANGES: ${{ needs.setup-jobs.outputs.show_upcoming_changes }}
|
| 229 |
+
FREECODECAMP_NODE_ENV: production
|
| 230 |
+
# The below is used in ecosystem.config.js file for the API -- to be removed later
|
| 231 |
+
DEPLOYMENT_ENV: ${{ needs.setup-jobs.outputs.tgt_env_long }}
|
| 232 |
+
# The above is used in ecosystem.config.js file for the API -- to be removed later
|
| 233 |
+
run: |
|
| 234 |
+
pnpm install
|
| 235 |
+
pnpm run build
|
| 236 |
+
|
| 237 |
+
- name: Free up space
|
| 238 |
+
run: pnpm run clean:packages
|
| 239 |
+
|
| 240 |
+
- name: Tar Files
|
| 241 |
+
run: tar -czf client-${{ matrix.lang-name-short }}.tar client/public
|
| 242 |
+
|
| 243 |
+
- name: Setup and connect to Tailscale network
|
| 244 |
+
uses: tailscale/github-action@306e68a486fd2350f2bfc3b19fcd143891a4a2d8 # v4
|
| 245 |
+
with:
|
| 246 |
+
oauth-client-id: ${{ secrets.TS_OAUTH_CLIENT_ID }}
|
| 247 |
+
oauth-secret: ${{ secrets.TS_OAUTH_SECRET }}
|
| 248 |
+
hostname: gha-${{needs.setup-jobs.outputs.tgt_env_short}}-clients-ci-${{ github.run_id }}
|
| 249 |
+
tags: tag:ci
|
| 250 |
+
version: latest
|
| 251 |
+
|
| 252 |
+
- name: Wait for Tailscale Network Readiness
|
| 253 |
+
run: |
|
| 254 |
+
echo "Waiting for Tailscale network to be ready..."
|
| 255 |
+
max_wait=60
|
| 256 |
+
elapsed=0
|
| 257 |
+
|
| 258 |
+
while [ $elapsed -lt $max_wait ]; do
|
| 259 |
+
if tailscale status --json | jq -e '.BackendState == "Running"' > /dev/null 2>&1; then
|
| 260 |
+
echo "Tailscale network is ready"
|
| 261 |
+
break
|
| 262 |
+
fi
|
| 263 |
+
sleep 2
|
| 264 |
+
elapsed=$((elapsed + 2))
|
| 265 |
+
done
|
| 266 |
+
|
| 267 |
+
if [ $elapsed -ge $max_wait ]; then
|
| 268 |
+
echo "Tailscale network not ready after ${max_wait}s"
|
| 269 |
+
exit 1
|
| 270 |
+
fi
|
| 271 |
+
|
| 272 |
+
- name: Configure SSH & Check Connection
|
| 273 |
+
run: |
|
| 274 |
+
mkdir -p ~/.ssh
|
| 275 |
+
echo "Host *
|
| 276 |
+
UserKnownHostsFile=/dev/null
|
| 277 |
+
StrictHostKeyChecking no" > ~/.ssh/config
|
| 278 |
+
chmod 644 ~/.ssh/config
|
| 279 |
+
|
| 280 |
+
scrub_ips() {
|
| 281 |
+
sed -E 's/100(\.[0-9]{1,3}){3}/100.x.x.x/g'
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
validate_connection() {
|
| 285 |
+
local machine_name=$1
|
| 286 |
+
local max_retries=3
|
| 287 |
+
local retry_delay=5
|
| 288 |
+
local ping_output ssh_output
|
| 289 |
+
|
| 290 |
+
for attempt in $(seq 1 $max_retries); do
|
| 291 |
+
echo "Connection attempt $attempt/$max_retries to $machine_name"
|
| 292 |
+
|
| 293 |
+
if ! ping_output=$(tailscale ping -c 1 --until-direct=false --timeout=5s "$machine_name" 2>&1); then
|
| 294 |
+
ping_output=$(printf '%s' "$ping_output" | scrub_ips)
|
| 295 |
+
echo "No Tailscale data path to $machine_name: $ping_output"
|
| 296 |
+
if [ $attempt -eq $max_retries ]; then
|
| 297 |
+
return 1
|
| 298 |
+
fi
|
| 299 |
+
sleep $retry_delay
|
| 300 |
+
continue
|
| 301 |
+
fi
|
| 302 |
+
|
| 303 |
+
MACHINE_IP=$(tailscale ip -4 $machine_name)
|
| 304 |
+
if ssh_output=$(ssh -o ConnectTimeout=10 -o BatchMode=yes $TS_USERNAME@$MACHINE_IP "echo 'Connection test'; uptime" 2>&1); then
|
| 305 |
+
echo "Successfully validated connection to $machine_name"
|
| 306 |
+
return 0
|
| 307 |
+
fi
|
| 308 |
+
|
| 309 |
+
ssh_output=$(printf '%s' "$ssh_output" | scrub_ips)
|
| 310 |
+
echo "SSH validation failed for $machine_name: $ssh_output"
|
| 311 |
+
if [ $attempt -lt $max_retries ]; then
|
| 312 |
+
sleep $retry_delay
|
| 313 |
+
fi
|
| 314 |
+
done
|
| 315 |
+
|
| 316 |
+
echo "Failed to establish connection to $machine_name after $max_retries attempts"
|
| 317 |
+
return 1
|
| 318 |
+
}
|
| 319 |
+
|
| 320 |
+
echo -e "\nLOG:Validating connections to all machines..."
|
| 321 |
+
for i in {0..1}; do
|
| 322 |
+
TS_MACHINE_NAME=${TS_MACHINE_NAME_PREFIX}-${{ matrix.lang-name-short }}-${i}
|
| 323 |
+
echo "Validating connection to $TS_MACHINE_NAME"
|
| 324 |
+
if ! validate_connection "$TS_MACHINE_NAME"; then
|
| 325 |
+
echo "Error: Failed to establish reliable connection to $TS_MACHINE_NAME"
|
| 326 |
+
exit 1
|
| 327 |
+
fi
|
| 328 |
+
done
|
| 329 |
+
echo "All machine connections validated successfully"
|
| 330 |
+
|
| 331 |
+
- name: Upload and Deploy
|
| 332 |
+
run: |
|
| 333 |
+
for i in {0..1}; do
|
| 334 |
+
TS_MACHINE_NAME=${TS_MACHINE_NAME_PREFIX}-${{ matrix.lang-name-short }}-${i}
|
| 335 |
+
CURRENT_DATE=$(date +%Y%m%d)
|
| 336 |
+
CLIENT_SRC=client-${{ matrix.lang-name-short }}.tar
|
| 337 |
+
CLIENT_DST=/tmp/client-${{ matrix.lang-name-short }}-${CURRENT_DATE}-${{ github.run_id }}.tar
|
| 338 |
+
CLIENT_BINARIES=${{needs.setup-jobs.outputs.tgt_env_short}}-release-$CURRENT_DATE-${{ github.run_id }}
|
| 339 |
+
|
| 340 |
+
echo -e "\nLOG:Uploading client archive to $TS_MACHINE_NAME..."
|
| 341 |
+
MACHINE_IP=$(tailscale ip -4 $TS_MACHINE_NAME)
|
| 342 |
+
scp $CLIENT_SRC $TS_USERNAME@$MACHINE_IP:$CLIENT_DST
|
| 343 |
+
|
| 344 |
+
REMOTE_SCRIPT="
|
| 345 |
+
set -e
|
| 346 |
+
echo -e '\nLOG: Deploying client - $CLIENT_BINARIES to $TS_MACHINE_NAME...'
|
| 347 |
+
|
| 348 |
+
echo -e '\nLOG:Extracting client archive...'
|
| 349 |
+
mkdir -p /home/$TS_USERNAME/client/releases/$CLIENT_BINARIES
|
| 350 |
+
tar -xzf $CLIENT_DST -C /home/$TS_USERNAME/client/releases/$CLIENT_BINARIES --strip-components=2
|
| 351 |
+
|
| 352 |
+
echo -e '\nLOG:Cleaning up client archive...'
|
| 353 |
+
rm $CLIENT_DST
|
| 354 |
+
|
| 355 |
+
echo -e '\nLOG:Checking client archive size...'
|
| 356 |
+
du -sh /home/$TS_USERNAME/client/releases/$CLIENT_BINARIES
|
| 357 |
+
|
| 358 |
+
echo -e '\nLOG:Environment setup...'
|
| 359 |
+
cd /home/$TS_USERNAME/client
|
| 360 |
+
export NVM_DIR=\$HOME/.nvm && [ -s "\$NVM_DIR/nvm.sh" ] && source "\$NVM_DIR/nvm.sh"
|
| 361 |
+
echo -e '\nLOG:Checking available Node.js versions...'
|
| 362 |
+
nvm ls | grep 'default'
|
| 363 |
+
echo -e '\nLOG:Checking Node.js version...'
|
| 364 |
+
node --version
|
| 365 |
+
|
| 366 |
+
echo -e '\nLOG:Installing serve...'
|
| 367 |
+
npm install -g serve@13
|
| 368 |
+
|
| 369 |
+
echo -e '\nLOG:Primary client setup...'
|
| 370 |
+
rm -f client-start-primary.sh
|
| 371 |
+
echo \"serve -c ../../serve.json releases/$CLIENT_BINARIES -p 50505\" >> client-start-primary.sh
|
| 372 |
+
chmod +x client-start-primary.sh
|
| 373 |
+
pm2 delete client-primary || true
|
| 374 |
+
pm2 start ./client-start-primary.sh --name client-primary
|
| 375 |
+
echo -e '\nLOG:Primary client setup completed.'
|
| 376 |
+
|
| 377 |
+
pm2 ls
|
| 378 |
+
|
| 379 |
+
echo -e '\nLOG:Secondary client setup...'
|
| 380 |
+
rm -f client-start-secondary.sh
|
| 381 |
+
echo \"serve -c ../../serve.json releases/$CLIENT_BINARIES -p 52525\" >> client-start-secondary.sh
|
| 382 |
+
chmod +x client-start-secondary.sh
|
| 383 |
+
pm2 delete client-secondary || true
|
| 384 |
+
pm2 start ./client-start-secondary.sh --name client-secondary
|
| 385 |
+
echo -e '\nLOG:Secondary client setup completed.'
|
| 386 |
+
|
| 387 |
+
pm2 ls
|
| 388 |
+
pm2 save
|
| 389 |
+
|
| 390 |
+
echo -e '\nLOG:Finished deployment.'
|
| 391 |
+
"
|
| 392 |
+
ssh $TS_USERNAME@$MACHINE_IP "$REMOTE_SCRIPT"
|
| 393 |
+
done
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/devcontainer-ci.yml
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CI - Devcontainer
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request:
|
| 5 |
+
paths:
|
| 6 |
+
- '.devcontainer/**'
|
| 7 |
+
- 'docker/devcontainer/**'
|
| 8 |
+
- 'docker/docker-compose.yml'
|
| 9 |
+
- '.github/workflows/devcontainer-ci.yml'
|
| 10 |
+
- 'sample.env'
|
| 11 |
+
- 'package.json'
|
| 12 |
+
- 'turbo.json'
|
| 13 |
+
- 'pnpm-lock.yaml'
|
| 14 |
+
- 'client/package.json'
|
| 15 |
+
- 'client/turbo.json'
|
| 16 |
+
workflow_dispatch:
|
| 17 |
+
|
| 18 |
+
concurrency:
|
| 19 |
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
| 20 |
+
cancel-in-progress: true
|
| 21 |
+
|
| 22 |
+
permissions:
|
| 23 |
+
contents: read
|
| 24 |
+
|
| 25 |
+
jobs:
|
| 26 |
+
validate:
|
| 27 |
+
name: Validate
|
| 28 |
+
runs-on: ubuntu-24.04
|
| 29 |
+
|
| 30 |
+
steps:
|
| 31 |
+
- name: Checkout
|
| 32 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 33 |
+
|
| 34 |
+
- name: Set up Docker Buildx
|
| 35 |
+
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
|
| 36 |
+
|
| 37 |
+
- name: Install devcontainer CLI
|
| 38 |
+
# renovate: datasource=npm depName=@devcontainers/cli
|
| 39 |
+
run: npm install -g @devcontainers/cli@0.83.0
|
| 40 |
+
|
| 41 |
+
- name: Build the devcontainer image from this branch
|
| 42 |
+
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7
|
| 43 |
+
with:
|
| 44 |
+
files: docker/devcontainer/docker-bake.hcl
|
| 45 |
+
targets: local-devcontainer
|
| 46 |
+
load: true
|
| 47 |
+
|
| 48 |
+
- name: Start devcontainer
|
| 49 |
+
run: devcontainer up --workspace-folder .
|
| 50 |
+
|
| 51 |
+
- name: Validate required tools
|
| 52 |
+
run: |
|
| 53 |
+
devcontainer exec --workspace-folder . pnpm --version
|
| 54 |
+
devcontainer exec --workspace-folder . rsync --version
|
| 55 |
+
devcontainer exec --workspace-folder . mongosh --version
|
| 56 |
+
devcontainer exec --workspace-folder . node --version
|
| 57 |
+
devcontainer exec --workspace-folder . git --version
|
| 58 |
+
devcontainer exec --workspace-folder . gh --version
|
| 59 |
+
|
| 60 |
+
- name: Validate MongoDB is writable
|
| 61 |
+
run: |
|
| 62 |
+
for i in $(seq 1 30); do
|
| 63 |
+
if devcontainer exec --workspace-folder . mongosh --quiet --eval 'if (!db.hello().isWritablePrimary) quit(1)'; then
|
| 64 |
+
echo "Replica set is writable"
|
| 65 |
+
exit 0
|
| 66 |
+
fi
|
| 67 |
+
echo "Waiting for a writable primary... (attempt $i/30)"
|
| 68 |
+
sleep 2
|
| 69 |
+
done
|
| 70 |
+
echo "Replica set failed to initialize"
|
| 71 |
+
exit 1
|
| 72 |
+
|
| 73 |
+
- name: Validate Mailpit is reachable
|
| 74 |
+
run: |
|
| 75 |
+
devcontainer exec --workspace-folder . bash -c 'exec 3<>/dev/tcp/localhost/1025 && head -1 <&3'
|
| 76 |
+
devcontainer exec --workspace-folder . bash -c 'exec 3<>/dev/tcp/localhost/8025'
|
| 77 |
+
|
| 78 |
+
- name: Validate the generated .env
|
| 79 |
+
run: |
|
| 80 |
+
devcontainer exec --workspace-folder . grep -q '^MAILPIT_HOST=localhost$' .env
|
| 81 |
+
devcontainer exec --workspace-folder . grep -q '^HOME_LOCATION=http://localhost:8000$' .env
|
| 82 |
+
|
| 83 |
+
- name: Validate the client answers on IPv4 loopback
|
| 84 |
+
run: |
|
| 85 |
+
devcontainer exec --workspace-folder . bash -c '
|
| 86 |
+
FCC_SUPERBLOCK=responsive-web-design pnpm run develop > /tmp/develop.log 2>&1 &
|
| 87 |
+
pid=$!
|
| 88 |
+
deadline=$((SECONDS + 2400))
|
| 89 |
+
while [ "$SECONDS" -lt "$deadline" ]; do
|
| 90 |
+
if ! kill -0 "$pid" 2>/dev/null; then
|
| 91 |
+
echo "pnpm run develop exited before the client answered"
|
| 92 |
+
cat /tmp/develop.log
|
| 93 |
+
exit 1
|
| 94 |
+
fi
|
| 95 |
+
if curl -sf -o /dev/null --max-time 10 http://127.0.0.1:8000/; then
|
| 96 |
+
echo "The client answers on 127.0.0.1:8000"
|
| 97 |
+
exit 0
|
| 98 |
+
fi
|
| 99 |
+
sleep 5
|
| 100 |
+
done
|
| 101 |
+
echo "The client never answered on 127.0.0.1:8000"
|
| 102 |
+
cat /tmp/develop.log
|
| 103 |
+
exit 1'
|
| 104 |
+
|
| 105 |
+
- name: Validate the Codespaces URL rewrite
|
| 106 |
+
run: |
|
| 107 |
+
devcontainer exec --workspace-folder . env \
|
| 108 |
+
CODESPACE_NAME=ci-probe \
|
| 109 |
+
GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN=app.github.dev \
|
| 110 |
+
.devcontainer/codespace-env.sh
|
| 111 |
+
devcontainer exec --workspace-folder . grep -q '^HOME_LOCATION=https://ci-probe-8000.app.github.dev$' .env
|
| 112 |
+
devcontainer exec --workspace-folder . grep -q '^API_LOCATION=https://ci-probe-3000.app.github.dev$' .env
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/docker-docr-cleanup.yml
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CD - Docker - DOCR Cleanup Container Images
|
| 2 |
+
on:
|
| 3 |
+
workflow_dispatch:
|
| 4 |
+
schedule:
|
| 5 |
+
- cron: '5 0 * * 3,6' # 12:05 UTC on Wednesdays and Saturdays (6 hour maintenance window)
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
remove:
|
| 9 |
+
name: Delete Old Images
|
| 10 |
+
runs-on: ubuntu-latest
|
| 11 |
+
strategy:
|
| 12 |
+
fail-fast: false
|
| 13 |
+
matrix:
|
| 14 |
+
repos:
|
| 15 |
+
- learn-api
|
| 16 |
+
variants:
|
| 17 |
+
- dev
|
| 18 |
+
- org
|
| 19 |
+
|
| 20 |
+
steps:
|
| 21 |
+
- name: Install doctl
|
| 22 |
+
uses: digitalocean/action-doctl@3cb3953159719656269e044e0e24ca16dd2a690f # v2.5.2
|
| 23 |
+
with:
|
| 24 |
+
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
| 25 |
+
|
| 26 |
+
- name: Log in to DigitalOcean Container Registry with short-lived credentials
|
| 27 |
+
run: doctl registry login --expiry-seconds 1200
|
| 28 |
+
|
| 29 |
+
- name: Delete Images
|
| 30 |
+
uses: raisedadead/action-docr-cleanup@1c7d87369bccfdf5da03a9ae3b00eacc3f2a9b51 # v1
|
| 31 |
+
with:
|
| 32 |
+
repository_name: '${{ matrix.variants }}/${{ matrix.repos }}'
|
| 33 |
+
days: '7'
|
| 34 |
+
keep_last: '3'
|
| 35 |
+
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/docker-docr.yml
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CD - Docker - DOCR
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch:
|
| 5 |
+
inputs:
|
| 6 |
+
site_tld:
|
| 7 |
+
required: true
|
| 8 |
+
type: choice
|
| 9 |
+
description: 'Input: The site tld (variant) to build'
|
| 10 |
+
options:
|
| 11 |
+
- dev
|
| 12 |
+
- org
|
| 13 |
+
default: 'dev'
|
| 14 |
+
app:
|
| 15 |
+
required: true
|
| 16 |
+
type: string
|
| 17 |
+
description: 'Input: The app (component) to build'
|
| 18 |
+
default: 'api'
|
| 19 |
+
show_upcoming_changes:
|
| 20 |
+
required: false
|
| 21 |
+
type: string
|
| 22 |
+
description: 'Input: Show upcoming changes flag (true/false)'
|
| 23 |
+
default: 'false'
|
| 24 |
+
workflow_call:
|
| 25 |
+
inputs:
|
| 26 |
+
site_tld:
|
| 27 |
+
required: true
|
| 28 |
+
type: string
|
| 29 |
+
description: 'Input: The site tld (variant) to build'
|
| 30 |
+
app:
|
| 31 |
+
required: true
|
| 32 |
+
type: string
|
| 33 |
+
description: 'Input: The app (component) to build'
|
| 34 |
+
show_upcoming_changes:
|
| 35 |
+
required: false
|
| 36 |
+
type: string
|
| 37 |
+
description: 'Input: Show upcoming changes flag (true/false)'
|
| 38 |
+
default: 'false'
|
| 39 |
+
secrets:
|
| 40 |
+
DIGITALOCEAN_ACCESS_TOKEN:
|
| 41 |
+
required: true
|
| 42 |
+
description: 'DigitalOcean API token for registry authentication'
|
| 43 |
+
DOCR_NAME:
|
| 44 |
+
required: true
|
| 45 |
+
description: 'DigitalOcean Container Registry name'
|
| 46 |
+
SENTRY_AUTH_TOKEN:
|
| 47 |
+
required: false
|
| 48 |
+
description: 'Sentry auth token for source map upload (api app only)'
|
| 49 |
+
outputs:
|
| 50 |
+
tagname:
|
| 51 |
+
description: 'Output: The tagname for the image built'
|
| 52 |
+
value: ${{ jobs.build.outputs.tagname }}
|
| 53 |
+
|
| 54 |
+
jobs:
|
| 55 |
+
build:
|
| 56 |
+
name: Build & Push
|
| 57 |
+
runs-on: ubuntu-24.04
|
| 58 |
+
permissions:
|
| 59 |
+
contents: read
|
| 60 |
+
outputs:
|
| 61 |
+
tagname: ${{ steps.tagname.outputs.tagname }}
|
| 62 |
+
|
| 63 |
+
steps:
|
| 64 |
+
- name: Checkout Source Files
|
| 65 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
|
| 66 |
+
|
| 67 |
+
- name: Create a tagname
|
| 68 |
+
id: tagname
|
| 69 |
+
run: |
|
| 70 |
+
tagname=$(git rev-parse --short HEAD)-$(date +%Y%m%d)-$(date +%H%M)
|
| 71 |
+
echo "tagname=$tagname" >> "$GITHUB_ENV"
|
| 72 |
+
echo "tagname=$tagname" >> "$GITHUB_OUTPUT"
|
| 73 |
+
|
| 74 |
+
- name: Set up Docker Buildx
|
| 75 |
+
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
|
| 76 |
+
|
| 77 |
+
- name: Install doctl
|
| 78 |
+
uses: digitalocean/action-doctl@3cb3953159719656269e044e0e24ca16dd2a690f # v2.5.2
|
| 79 |
+
with:
|
| 80 |
+
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
|
| 81 |
+
|
| 82 |
+
- name: Log in to DigitalOcean Container Registry with short-lived credentials
|
| 83 |
+
run: doctl registry login --expiry-seconds 1200
|
| 84 |
+
|
| 85 |
+
- name: Build & Push Image
|
| 86 |
+
uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7
|
| 87 |
+
with:
|
| 88 |
+
context: .
|
| 89 |
+
file: docker/${{ inputs.app }}/Dockerfile
|
| 90 |
+
push: true
|
| 91 |
+
build-args: |
|
| 92 |
+
SHOW_UPCOMING_CHANGES=${{ inputs.show_upcoming_changes }}
|
| 93 |
+
tags: |
|
| 94 |
+
registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ inputs.site_tld }}/learn-${{ inputs.app }}:${{ env.tagname }}
|
| 95 |
+
registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ inputs.site_tld }}/learn-${{ inputs.app }}:latest
|
| 96 |
+
cache-from: type=gha
|
| 97 |
+
cache-to: type=gha,mode=max
|
| 98 |
+
|
| 99 |
+
# TODO(o11y): source-map upload + release marking disabled pending a
|
| 100 |
+
# follow-up PR with a stable release-id scheme. Also fix the upload path
|
| 101 |
+
# when re-enabling: the image ships /home/node/fcc/api/src (dist flattened
|
| 102 |
+
# by the COPY in docker/api/Dockerfile), so `docker cp .../fcc/api` yields
|
| 103 |
+
# sentry-dist/api/src — the old upload pointed at sentry-dist/api/dist,
|
| 104 |
+
# which never exists (silent no-op, so maps never uploaded). Path below is
|
| 105 |
+
# pre-corrected to sentry-dist/api/src. See
|
| 106 |
+
# .scratchpad/o11y-cutover-review-2026-07-10.md.
|
| 107 |
+
# - name: Extract API dist for Sentry source maps
|
| 108 |
+
# if: inputs.app == 'api'
|
| 109 |
+
# run: |
|
| 110 |
+
# IMAGE="registry.digitalocean.com/${{ secrets.DOCR_NAME }}/${{ inputs.site_tld }}/learn-${{ inputs.app }}:${{ env.tagname }}"
|
| 111 |
+
# docker pull "$IMAGE"
|
| 112 |
+
# container_id=$(docker create "$IMAGE")
|
| 113 |
+
# mkdir -p sentry-dist
|
| 114 |
+
# docker cp "$container_id:/home/node/fcc/api" sentry-dist/
|
| 115 |
+
# docker rm "$container_id"
|
| 116 |
+
#
|
| 117 |
+
# - name: Upload source maps to Sentry (unfinalized)
|
| 118 |
+
# if: inputs.app == 'api'
|
| 119 |
+
# env:
|
| 120 |
+
# SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
| 121 |
+
# SENTRY_ORG: freecodecamp
|
| 122 |
+
# SENTRY_PROJECT: api-fastify
|
| 123 |
+
# run: |
|
| 124 |
+
# npx --yes @sentry/cli@3.6.0 releases new "${{ env.tagname }}"
|
| 125 |
+
# npx --yes @sentry/cli@3.6.0 sourcemaps upload --release "${{ env.tagname }}" sentry-dist/api/src
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/docker-ghcr.yml
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CD - Docker - GHCR Images
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
workflow_dispatch:
|
| 5 |
+
push:
|
| 6 |
+
branches:
|
| 7 |
+
- main
|
| 8 |
+
paths:
|
| 9 |
+
- 'pnpm-lock.yaml'
|
| 10 |
+
- 'package.json'
|
| 11 |
+
- 'docker/devcontainer/**'
|
| 12 |
+
- '.github/workflows/docker-ghcr.yml'
|
| 13 |
+
|
| 14 |
+
permissions:
|
| 15 |
+
contents: read
|
| 16 |
+
packages: write
|
| 17 |
+
|
| 18 |
+
jobs:
|
| 19 |
+
build-and-push:
|
| 20 |
+
name: Build and Push Images
|
| 21 |
+
runs-on: ubuntu-24.04
|
| 22 |
+
|
| 23 |
+
steps:
|
| 24 |
+
- name: Checkout
|
| 25 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 26 |
+
with:
|
| 27 |
+
submodules: 'recursive'
|
| 28 |
+
|
| 29 |
+
- name: Set up QEMU
|
| 30 |
+
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
|
| 31 |
+
|
| 32 |
+
- name: Set up Docker Buildx
|
| 33 |
+
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4
|
| 34 |
+
|
| 35 |
+
- name: Log in to GHCR
|
| 36 |
+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
|
| 37 |
+
with:
|
| 38 |
+
registry: ghcr.io
|
| 39 |
+
username: ${{ github.actor }}
|
| 40 |
+
password: ${{ secrets.GITHUB_TOKEN }}
|
| 41 |
+
|
| 42 |
+
- name: Build and push images
|
| 43 |
+
uses: docker/bake-action@d3418bd7d0e9324001bca92fa8ba175ea7e6dc9b # v7
|
| 44 |
+
with:
|
| 45 |
+
files: docker/devcontainer/docker-bake.hcl
|
| 46 |
+
targets: devcontainer
|
| 47 |
+
push: true
|
| 48 |
+
env:
|
| 49 |
+
TAG: ${{ github.sha }}
|
| 50 |
+
TAG_LATEST: ${{ github.ref_name == 'main' }}
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/e2e-playwright.yml
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: CI - E2E - Playwright
|
| 2 |
+
on:
|
| 3 |
+
workflow_call:
|
| 4 |
+
|
| 5 |
+
permissions:
|
| 6 |
+
contents: read
|
| 7 |
+
|
| 8 |
+
jobs:
|
| 9 |
+
playwright-run:
|
| 10 |
+
name: Run Playwright Tests
|
| 11 |
+
runs-on: ubuntu-24.04
|
| 12 |
+
strategy:
|
| 13 |
+
fail-fast: false
|
| 14 |
+
matrix:
|
| 15 |
+
# Extend this to include firefox and webkit once chromium is working.
|
| 16 |
+
browsers: [chromium]
|
| 17 |
+
node-version: [24]
|
| 18 |
+
|
| 19 |
+
steps:
|
| 20 |
+
- name: Set Action Environment Variables
|
| 21 |
+
run: |
|
| 22 |
+
echo "GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}" >> $GITHUB_ENV
|
| 23 |
+
|
| 24 |
+
- name: Checkout Source Files
|
| 25 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 26 |
+
with:
|
| 27 |
+
persist-credentials: false
|
| 28 |
+
|
| 29 |
+
- name: Download Client Artifact
|
| 30 |
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
| 31 |
+
with:
|
| 32 |
+
name: client-artifact
|
| 33 |
+
path: client/public
|
| 34 |
+
|
| 35 |
+
- name: Checkout client-config
|
| 36 |
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 37 |
+
with:
|
| 38 |
+
repository: freeCodeCamp/client-config
|
| 39 |
+
path: client-config
|
| 40 |
+
persist-credentials: false
|
| 41 |
+
|
| 42 |
+
- name: Move serve.json to Public Folder
|
| 43 |
+
run: cp client-config/serve.json client/public/serve.json
|
| 44 |
+
|
| 45 |
+
- name: Download Api Artifact
|
| 46 |
+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
|
| 47 |
+
with:
|
| 48 |
+
name: api-artifact
|
| 49 |
+
path: api-artifact
|
| 50 |
+
|
| 51 |
+
- name: Load API Image
|
| 52 |
+
run: |
|
| 53 |
+
docker load < api-artifact/api-artifact.tar
|
| 54 |
+
rm api-artifact/api-artifact.tar
|
| 55 |
+
|
| 56 |
+
- name: Use Node.js ${{ matrix.node-version }}
|
| 57 |
+
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6
|
| 58 |
+
with:
|
| 59 |
+
node-version: ${{ matrix.node-version }}
|
| 60 |
+
|
| 61 |
+
- name: Install pnpm
|
| 62 |
+
uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
|
| 63 |
+
id: pnpm-install
|
| 64 |
+
with:
|
| 65 |
+
run_install: false
|
| 66 |
+
|
| 67 |
+
- name: Install Dependencies
|
| 68 |
+
run: pnpm install
|
| 69 |
+
|
| 70 |
+
- name: Set freeCodeCamp Environment Variables (needed by api)
|
| 71 |
+
run: |
|
| 72 |
+
sed '/^[[:space:]]*#/d; /^$/d' sample.env >> $GITHUB_ENV
|
| 73 |
+
cp sample.env .env # for docker compose
|
| 74 |
+
|
| 75 |
+
- name: Install playwright dependencies
|
| 76 |
+
run: npx playwright install --with-deps
|
| 77 |
+
|
| 78 |
+
- name: Install
|
| 79 |
+
run: pnpm install
|
| 80 |
+
|
| 81 |
+
- name: Start apps
|
| 82 |
+
run: |
|
| 83 |
+
docker compose -f docker/docker-compose.yml -f docker/docker-compose.ports.yml -f docker/docker-compose.e2e.yml up -d
|
| 84 |
+
pnpm run serve:client-ci &
|
| 85 |
+
sleep 10
|
| 86 |
+
|
| 87 |
+
- name: Seed Database with Certified User
|
| 88 |
+
run: pnpm run seed:certified-user
|
| 89 |
+
|
| 90 |
+
- name: Run playwright tests
|
| 91 |
+
run: pnpm run playwright:run --project=${{ matrix.browsers }}
|
| 92 |
+
|
| 93 |
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
|
| 94 |
+
if: ${{ !cancelled() }}
|
| 95 |
+
with:
|
| 96 |
+
name: playwright-report-${{ matrix.browsers }}
|
| 97 |
+
path: e2e/playwright/reporter
|
| 98 |
+
retention-days: 7
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-autoclose.yml
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: GitHub - Autoclose Invalid PRs
|
| 2 |
+
on:
|
| 3 |
+
pull_request_target:
|
| 4 |
+
branches:
|
| 5 |
+
- 'main'
|
| 6 |
+
paths:
|
| 7 |
+
- '.gitignore'
|
| 8 |
+
|
| 9 |
+
permissions:
|
| 10 |
+
issues: write
|
| 11 |
+
pull-requests: write
|
| 12 |
+
jobs:
|
| 13 |
+
autoclose:
|
| 14 |
+
runs-on: ubuntu-24.04
|
| 15 |
+
steps:
|
| 16 |
+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 17 |
+
with:
|
| 18 |
+
github-token: ${{secrets.GITHUB_TOKEN}}
|
| 19 |
+
script: |
|
| 20 |
+
const files = await github.rest.pulls.listFiles({
|
| 21 |
+
owner: context.payload.repository.owner.login,
|
| 22 |
+
repo: context.payload.repository.name,
|
| 23 |
+
pull_number: context.payload.pull_request.number,
|
| 24 |
+
});
|
| 25 |
+
if (
|
| 26 |
+
files.data.length !== 1 ||
|
| 27 |
+
(files.data[0].filename !== ".gitignore" &&
|
| 28 |
+
// We've had four PRs make this same (irrelevant) change already.
|
| 29 |
+
!(files.data[0].filename === "664ef4623946e65e18d59764.md" &&
|
| 30 |
+
files.data[0].patch.includes("return re.sub('(?<!\d)1', '', equation_string.strip('+'))")
|
| 31 |
+
)
|
| 32 |
+
)
|
| 33 |
+
) {
|
| 34 |
+
return;
|
| 35 |
+
}
|
| 36 |
+
const creator = context.payload.sender.login;
|
| 37 |
+
const opts = github.rest.issues.listForRepo.endpoint.merge({
|
| 38 |
+
...context.issue,
|
| 39 |
+
creator,
|
| 40 |
+
state: 'all'
|
| 41 |
+
});
|
| 42 |
+
const issues = await github.paginate(opts);
|
| 43 |
+
|
| 44 |
+
// iterate through issues
|
| 45 |
+
for (const issue of issues) {
|
| 46 |
+
// if the issue is this one, keep looking
|
| 47 |
+
if (issue.number === context.issue.number) {
|
| 48 |
+
continue;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
// if the issue is actually a PR, they're not a first timer
|
| 52 |
+
if (issue.pull_request) {
|
| 53 |
+
return // Creator is already a contributor.
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
core.setFailed("Invalid PR detected.");
|
| 57 |
+
await github.rest.issues.createComment({
|
| 58 |
+
issue_number: context.issue.number,
|
| 59 |
+
owner: context.repo.owner,
|
| 60 |
+
repo: context.repo.repo,
|
| 61 |
+
body: "Thank you for opening this pull request.\n\nThis is a standard message notifying you that we've reviewed your pull request and have decided not to merge it. We would welcome future pull requests from you.\n\nThank you and happy coding.",
|
| 62 |
+
});
|
| 63 |
+
await github.rest.pulls.update({
|
| 64 |
+
owner: context.payload.repository.owner.login,
|
| 65 |
+
repo: context.payload.repository.name,
|
| 66 |
+
pull_number: context.payload.pull_request.number,
|
| 67 |
+
state: "closed"
|
| 68 |
+
});
|
| 69 |
+
await github.rest.issues.addLabels({
|
| 70 |
+
owner: context.payload.repository.owner.login,
|
| 71 |
+
repo: context.payload.repository.name,
|
| 72 |
+
issue_number: context.issue.number,
|
| 73 |
+
labels: ["spam"]
|
| 74 |
+
});
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-labeler.yaml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: GitHub - Label PRs
|
| 2 |
+
on:
|
| 3 |
+
- pull_request_target
|
| 4 |
+
|
| 5 |
+
permissions:
|
| 6 |
+
contents: read
|
| 7 |
+
|
| 8 |
+
concurrency:
|
| 9 |
+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.workflow_run.head_branch || github.ref }}
|
| 10 |
+
cancel-in-progress: true
|
| 11 |
+
|
| 12 |
+
jobs:
|
| 13 |
+
triage:
|
| 14 |
+
permissions:
|
| 15 |
+
# for actions/labeler to determine modified files
|
| 16 |
+
contents: read
|
| 17 |
+
# for actions/labeler to add labels to PRs
|
| 18 |
+
pull-requests: write
|
| 19 |
+
runs-on: ubuntu-24.04
|
| 20 |
+
steps:
|
| 21 |
+
- uses: actions/labeler@b8dd2d9be0f68b860e7dae5dae7d772984eacd6d # v6
|
| 22 |
+
with:
|
| 23 |
+
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
| 24 |
+
sync-labels: true
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-lock-closed-prs.yml
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: GitHub - Lock Closed PRs
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request_target:
|
| 5 |
+
types: [closed]
|
| 6 |
+
|
| 7 |
+
permissions:
|
| 8 |
+
issues: write
|
| 9 |
+
pull-requests: write
|
| 10 |
+
jobs:
|
| 11 |
+
lock:
|
| 12 |
+
name: Lock Closed PR
|
| 13 |
+
runs-on: ubuntu-24.04
|
| 14 |
+
steps:
|
| 15 |
+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 16 |
+
with:
|
| 17 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 18 |
+
script: |
|
| 19 |
+
await github.rest.issues.lock({
|
| 20 |
+
owner: context.repo.owner,
|
| 21 |
+
repo: context.repo.repo,
|
| 22 |
+
issue_number: context.issue.number,
|
| 23 |
+
lock_reason: 'resolved'
|
| 24 |
+
});
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-no-i18n-via-prs.yml
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: GitHub - No translations via PRs
|
| 2 |
+
on:
|
| 3 |
+
pull_request_target:
|
| 4 |
+
branches:
|
| 5 |
+
- 'main'
|
| 6 |
+
paths:
|
| 7 |
+
- 'client/i18n/locales/**/intro.json'
|
| 8 |
+
- 'client/i18n/locales/**/translations.json'
|
| 9 |
+
- '!client/i18n/locales/english/**'
|
| 10 |
+
|
| 11 |
+
jobs:
|
| 12 |
+
has-translation:
|
| 13 |
+
runs-on: ubuntu-24.04
|
| 14 |
+
steps:
|
| 15 |
+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 16 |
+
with:
|
| 17 |
+
github-token: ${{secrets.CAMPERBOT_NO_TRANSLATE}}
|
| 18 |
+
script: |
|
| 19 |
+
const isDev = await github.rest.teams.getMembershipForUserInOrg({
|
| 20 |
+
org: "freeCodeCamp",
|
| 21 |
+
team_slug: "dev-team",
|
| 22 |
+
username: context.payload.pull_request.user.login
|
| 23 |
+
}).catch(() => ({status: 404}));
|
| 24 |
+
if (context.payload.pull_request.user.login !== "camperbot" && isDev.status !== 200) {
|
| 25 |
+
core.setFailed('This PR appears to touch translated curriculum files.')
|
| 26 |
+
await github.rest.issues.createComment({
|
| 27 |
+
issue_number: context.issue.number,
|
| 28 |
+
owner: context.repo.owner,
|
| 29 |
+
repo: context.repo.repo,
|
| 30 |
+
body: "Thanks for your pull request.\n\n**Please remove the changes made to the non-English versions of the files. No need to close this pull request; just add more commits as needed.**\n\nWe require you to change **only English** versions of files in the codebase. Translations to corresponding files in other world languages are managed on our translation platform. Once your pull request is merged, changes will be synced automatically to other world languages.\n\nPlease visit [our contributing guidelines](https://contribute.freecodecamp.org) to learn more about translating freeCodeCamp's resources.\n\nAs always, we value all of your contributions.\n\nHappy contributing!\n\n---\n_**Note:** This message was automatically generated by a bot. If you feel this message is in error or would like help resolving it, feel free to reach us [in our contributor chat](https://discord.gg/PRyKn3Vbay)._"
|
| 31 |
+
})
|
| 32 |
+
} else if (isDev.status === 200) {
|
| 33 |
+
core.setFailed('This PR appears to touch translated curriculum files, but since you are on the dev team there is no message.');
|
| 34 |
+
}
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-pr-guidelines.yml
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: GitHub - PR Contribution Guidelines
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
pull_request_target:
|
| 5 |
+
types: [opened, reopened, edited]
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
# Ensures PR commits were not added via the GitHub Web UI, which typically indicates
|
| 9 |
+
# the contributor hasn't tested their changes in a local development environment.
|
| 10 |
+
no-web-commits:
|
| 11 |
+
name: No Commits on GitHub Web
|
| 12 |
+
runs-on: ubuntu-24.04
|
| 13 |
+
outputs:
|
| 14 |
+
is_allow_listed: ${{ steps.pr_author.outputs.is_allow_listed }}
|
| 15 |
+
steps:
|
| 16 |
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 17 |
+
with:
|
| 18 |
+
sparse-checkout: .github/scripts/pr-guidelines
|
| 19 |
+
sparse-checkout-cone-mode: false
|
| 20 |
+
|
| 21 |
+
- name: Check if PR author is allow-listed
|
| 22 |
+
id: pr_author
|
| 23 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 24 |
+
with:
|
| 25 |
+
# GITHUB_TOKEN does not have the read:org permission needed for this call
|
| 26 |
+
# while CAMPERBOT_NO_TRANSLATE does, since it is a PAT for the camperbot account with read:org scope
|
| 27 |
+
github-token: ${{ secrets.CAMPERBOT_NO_TRANSLATE }}
|
| 28 |
+
script: |
|
| 29 |
+
const fn = require('./.github/scripts/pr-guidelines/check-allow-list.js');
|
| 30 |
+
await fn({ github, context, core });
|
| 31 |
+
|
| 32 |
+
- name: Check if commits are made on GitHub Web UI
|
| 33 |
+
id: check-commits
|
| 34 |
+
if: steps.pr_author.outputs.is_allow_listed == 'false' && github.event.action != 'edited'
|
| 35 |
+
env:
|
| 36 |
+
HEAD_REF: ${{ github.head_ref }}
|
| 37 |
+
run: |
|
| 38 |
+
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
|
| 39 |
+
COMMITS_URL="https://api.github.com/repos/$GITHUB_REPOSITORY/pulls/$PR_NUMBER/commits"
|
| 40 |
+
HAS_GITHUB_SIGNED_COMMIT=$(curl --header "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" "$COMMITS_URL" | jq '[.[] | select(.commit.committer.name == "GitHub") | select(.commit.message | test("revert"; "i") | not)] | length > 0')
|
| 41 |
+
# GitHub Codespaces also produces GitHub-signed commits, but Codespaces users
|
| 42 |
+
# work on descriptively named branches. The web editor defaults to patch-N branches.
|
| 43 |
+
IS_PATCH_BRANCH=false
|
| 44 |
+
if [[ "$HEAD_REF" =~ ^patch-[0-9]+$ ]]; then
|
| 45 |
+
IS_PATCH_BRANCH=true
|
| 46 |
+
fi
|
| 47 |
+
if [ "$HAS_GITHUB_SIGNED_COMMIT" = "true" ] && [ "$IS_PATCH_BRANCH" = "true" ]; then
|
| 48 |
+
echo "IS_GITHUB_COMMIT=true" >> $GITHUB_ENV
|
| 49 |
+
fi
|
| 50 |
+
|
| 51 |
+
- name: Add comment on PR if commits are made on GitHub Web UI
|
| 52 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 53 |
+
if: steps.pr_author.outputs.is_allow_listed == 'false' && env.IS_GITHUB_COMMIT == 'true' && github.event.action != 'edited'
|
| 54 |
+
with:
|
| 55 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 56 |
+
script: |
|
| 57 |
+
core.setFailed("Commits were added via the GitHub Web UI.");
|
| 58 |
+
await github.rest.issues.createComment({
|
| 59 |
+
issue_number: context.issue.number,
|
| 60 |
+
owner: context.repo.owner,
|
| 61 |
+
repo: context.repo.repo,
|
| 62 |
+
body: "Thanks for your pull request.\n\n**Please do not add commits via the GitHub Web UI.**\n\nIt generally means you have yet to test these changes in a development setup or complete any prerequisites. We need you to follow the guides mentioned in the checklist. Please revalidate these changes in a developer environment and confirm how you validated your changes.\n\nHappy contributing!\n\n---\n_**Note:** This message was automatically generated by a bot. If you feel this message is in error or would like help resolving it, feel free to reach us [in our contributor chat](https://discord.gg/PRyKn3Vbay)._"
|
| 63 |
+
});
|
| 64 |
+
|
| 65 |
+
- name: Add deprioritized label
|
| 66 |
+
if: failure()
|
| 67 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 68 |
+
with:
|
| 69 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 70 |
+
script: |
|
| 71 |
+
await github.rest.issues.addLabels({
|
| 72 |
+
owner: context.repo.owner,
|
| 73 |
+
repo: context.repo.repo,
|
| 74 |
+
issue_number: context.issue.number,
|
| 75 |
+
labels: ['deprioritized']
|
| 76 |
+
});
|
| 77 |
+
|
| 78 |
+
# Ensures PRs are not opened directly from the contributor's main branch, which makes
|
| 79 |
+
# it hard to keep the PR up to date as the upstream repository progresses.
|
| 80 |
+
# Kept as a standalone job so it does not depend on the web-commit checks.
|
| 81 |
+
no-main-branch:
|
| 82 |
+
name: No PRs from Main Branch
|
| 83 |
+
runs-on: ubuntu-24.04
|
| 84 |
+
steps:
|
| 85 |
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 86 |
+
with:
|
| 87 |
+
sparse-checkout: .github/scripts/pr-guidelines
|
| 88 |
+
sparse-checkout-cone-mode: false
|
| 89 |
+
|
| 90 |
+
- name: Check if PR author is allow-listed
|
| 91 |
+
id: pr_author
|
| 92 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 93 |
+
with:
|
| 94 |
+
# GITHUB_TOKEN does not have the read:org permission needed for this call
|
| 95 |
+
# while CAMPERBOT_NO_TRANSLATE does, since it is a PAT for the camperbot account with read:org scope
|
| 96 |
+
github-token: ${{ secrets.CAMPERBOT_NO_TRANSLATE }}
|
| 97 |
+
script: |
|
| 98 |
+
const fn = require('./.github/scripts/pr-guidelines/check-allow-list.js');
|
| 99 |
+
await fn({ github, context, core });
|
| 100 |
+
|
| 101 |
+
- name: Check if PR is opened from the main branch
|
| 102 |
+
id: check-main-branch
|
| 103 |
+
if: steps.pr_author.outputs.is_allow_listed == 'false'
|
| 104 |
+
env:
|
| 105 |
+
HEAD_REF: ${{ github.head_ref }}
|
| 106 |
+
run: |
|
| 107 |
+
if [ "$HEAD_REF" = "main" ]; then
|
| 108 |
+
echo "IS_MAIN_BRANCH=true" >> $GITHUB_ENV
|
| 109 |
+
fi
|
| 110 |
+
|
| 111 |
+
- name: Add comment on PR if head branch is main
|
| 112 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 113 |
+
if: steps.pr_author.outputs.is_allow_listed == 'false' && env.IS_MAIN_BRANCH == 'true' && github.event.action != 'edited'
|
| 114 |
+
with:
|
| 115 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 116 |
+
script: |
|
| 117 |
+
await github.rest.issues.createComment({
|
| 118 |
+
issue_number: context.issue.number,
|
| 119 |
+
owner: context.repo.owner,
|
| 120 |
+
repo: context.repo.repo,
|
| 121 |
+
body: "Thanks for your pull request.\n\n**We recommend opening pull requests from a dedicated branch rather than your `main` branch.**\n\nUsing a separate branch for each change lets you work on multiple things at the same time without them interfering with one another. Since this PR is opened from your `main` branch, any new commits you push to `main` will be added to this PR while it stays open. After it is merged, you will need to reset your `main` branch as described in the [basic Git workflow guide](https://contribute.freecodecamp.org/basic-git-workflow/) to keep it in sync with the upstream repository.\n\nHappy contributing!\n\n---\n_**Note:** This message was automatically generated by a bot. If you feel this message is in error or would like help resolving it, feel free to reach us [in our contributor chat](https://discord.gg/PRyKn3Vbay)._"
|
| 122 |
+
});
|
| 123 |
+
|
| 124 |
+
- name: Fail if head branch is main
|
| 125 |
+
if: steps.pr_author.outputs.is_allow_listed == 'false' && env.IS_MAIN_BRANCH == 'true'
|
| 126 |
+
run: exit 1
|
| 127 |
+
|
| 128 |
+
- name: Add deprioritized label
|
| 129 |
+
if: failure()
|
| 130 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 131 |
+
with:
|
| 132 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 133 |
+
script: |
|
| 134 |
+
await github.rest.issues.addLabels({
|
| 135 |
+
owner: context.repo.owner,
|
| 136 |
+
repo: context.repo.repo,
|
| 137 |
+
issue_number: context.issue.number,
|
| 138 |
+
labels: ['deprioritized']
|
| 139 |
+
});
|
| 140 |
+
|
| 141 |
+
# Normalizes PR titles to follow Conventional Commits format, applying fuzzy fixes
|
| 142 |
+
# for common mistakes like typos, missing colons, or incorrect spacing.
|
| 143 |
+
fix-pr-title:
|
| 144 |
+
name: Fix PR Title
|
| 145 |
+
runs-on: ubuntu-24.04
|
| 146 |
+
needs: [no-web-commits, no-main-branch]
|
| 147 |
+
if: needs.no-web-commits.result == 'success' && needs.no-main-branch.result == 'success' && github.event.action != 'edited'
|
| 148 |
+
steps:
|
| 149 |
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 150 |
+
with:
|
| 151 |
+
sparse-checkout: .github/scripts/pr-guidelines
|
| 152 |
+
sparse-checkout-cone-mode: false
|
| 153 |
+
|
| 154 |
+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 155 |
+
with:
|
| 156 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 157 |
+
script: |
|
| 158 |
+
const fn = require('./.github/scripts/pr-guidelines/fix-pr-title.js');
|
| 159 |
+
await fn({ github, context });
|
| 160 |
+
|
| 161 |
+
# Checks that the PR description still contains the required template.
|
| 162 |
+
# The first 3 checkboxes must be ticked ([x] or [X]).
|
| 163 |
+
# The last checkbox (tested locally) is acceptable to leave unticked
|
| 164 |
+
# but removing the entire template is not.
|
| 165 |
+
check-pr-template:
|
| 166 |
+
name: Check PR Template
|
| 167 |
+
runs-on: ubuntu-24.04
|
| 168 |
+
needs: [no-web-commits, no-main-branch]
|
| 169 |
+
if: needs.no-web-commits.result == 'success' && needs.no-main-branch.result == 'success'
|
| 170 |
+
outputs:
|
| 171 |
+
failure_reason: ${{ steps.check.outputs.failure_reason }}
|
| 172 |
+
steps:
|
| 173 |
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 174 |
+
with:
|
| 175 |
+
sparse-checkout: .github/scripts/pr-guidelines
|
| 176 |
+
sparse-checkout-cone-mode: false
|
| 177 |
+
|
| 178 |
+
- id: check
|
| 179 |
+
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 180 |
+
with:
|
| 181 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 182 |
+
script: |
|
| 183 |
+
const fn = require('./.github/scripts/pr-guidelines/check-pr-template.js');
|
| 184 |
+
await fn({ github, context, core, isAllowListed: '${{ needs.no-web-commits.outputs.is_allow_listed }}' });
|
| 185 |
+
|
| 186 |
+
# Coordinates reporting: posts a single combined comment when checks fail,
|
| 187 |
+
# or removes the deprioritized label when all checks pass.
|
| 188 |
+
report:
|
| 189 |
+
name: Report
|
| 190 |
+
runs-on: ubuntu-24.04
|
| 191 |
+
needs: [no-web-commits, no-main-branch, check-pr-template]
|
| 192 |
+
if: always() && needs.no-web-commits.result == 'success' && needs.no-main-branch.result == 'success'
|
| 193 |
+
steps:
|
| 194 |
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
| 195 |
+
with:
|
| 196 |
+
sparse-checkout: .github/scripts/pr-guidelines
|
| 197 |
+
sparse-checkout-cone-mode: false
|
| 198 |
+
|
| 199 |
+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 200 |
+
with:
|
| 201 |
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
| 202 |
+
script: |
|
| 203 |
+
const fn = require('./.github/scripts/pr-guidelines/report-results.js');
|
| 204 |
+
await fn({
|
| 205 |
+
github,
|
| 206 |
+
context,
|
| 207 |
+
templateResult: '${{ needs.check-pr-template.result }}',
|
| 208 |
+
templateReason: '${{ needs.check-pr-template.outputs.failure_reason }}'
|
| 209 |
+
});
|
github_code/freeCodeCamp__freeCodeCamp/.github/workflows/github-spam.yml
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: GitHub - Spam PR
|
| 2 |
+
on:
|
| 3 |
+
pull_request_target:
|
| 4 |
+
types:
|
| 5 |
+
- labeled
|
| 6 |
+
|
| 7 |
+
permissions: {}
|
| 8 |
+
jobs:
|
| 9 |
+
is-spam:
|
| 10 |
+
runs-on: ubuntu-24.04
|
| 11 |
+
steps:
|
| 12 |
+
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
| 13 |
+
with:
|
| 14 |
+
github-token: ${{secrets.CAMPERBOT_NO_TRANSLATE}}
|
| 15 |
+
script: |
|
| 16 |
+
if (context.payload.label.name === "spam") {
|
| 17 |
+
try {
|
| 18 |
+
await github.rest.issues.createComment({
|
| 19 |
+
issue_number: context.issue.number,
|
| 20 |
+
owner: context.repo.owner,
|
| 21 |
+
repo: context.repo.repo,
|
| 22 |
+
body: "We are marking this pull request as spam. Please note that if you are participating in Hacktoberfest, two or more PRs marked as spam will result in your permanent disqualification.\n\nIf you are interested in making quality and genuine contributions to our projects, check out our [contributing guidelines](https://contribute.freecodecamp.org)."
|
| 23 |
+
});
|
| 24 |
+
} catch {
|
| 25 |
+
// Conversation may already be locked — ignore.
|
| 26 |
+
}
|
| 27 |
+
}
|