-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'freeCodeCamp:main' into main
- Loading branch information
Showing
41 changed files
with
2,577 additions
and
595 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Check README Suffixes | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'README-*' | ||
|
||
jobs: | ||
check-readme-suffixes: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 3.0 | ||
|
||
- name: Install dependencies | ||
run: | | ||
gem install nokogiri | ||
- name: Check README suffixes | ||
run: | | ||
# Scrape ISO 639 language codes from the Wiki page | ||
wget -qO- https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes | \ | ||
nokogiri -e 'puts $_.css(".wikitable td:nth-child(2)").map(&:text)' | \ | ||
sed -nr '/^.{0,2}$/p' | # Grab only two letter values | ||
tr '[:lower:]' '[:upper:]' > iso639.txt # Covert letters to uppercase | ||
# Get list of README file names | ||
readme_suffixes=$(ls README-* | sed 's/README-//g; s/.md//g') | ||
# Check if README suffixes are valid ISO 639 language codes | ||
for suffix in $readme_suffixes; do | ||
if ! grep -qw "$suffix" iso639.txt; then | ||
echo "Error: Invalid README suffix found: $suffix" | ||
exit 1 | ||
fi | ||
done | ||
echo "All README suffixes are valid ISO 639 language codes." | ||
# Add more steps for your existing workflow, e.g., running tests or other checks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.