Skip to content

About

ALGORYTHM IIT Bhilai — session slide decks + student bio pages hub (auto-merged PRs, GitHub Pages)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

33 Commits

Folders and files

Repository files navigation

ALGORYTHM Sessions - IIT Bhilai

Main hub for all ALGORYTHM session slide decks + student bio pages.

  • Live site: https://algorythm-iit-bhilai.vercel.app - serves index.html from main (auto-redeploys on every merge). The page reads students.json + sessions.json and renders the lists - no build step.
  • Slide decks: HTML files under sessions/<session-id>/. Linked from index.html via sessions.json. Since they are plain HTML, they open directly in the browser.
  • Student pages: each student owns students/<NAME>-<ID>-<GithubUsername>/index.html + one line in students.json. index.html at root reads that JSON and creates the directory of webpages.

Students get featured by opening a Pull Request. PRs that follow the exact format below are auto-merged by GitHub Actions.


1. For students - add your bio page (required workflow)

⚠️ You MUST create your own branch first. PRs raised directly from main are auto-rejected. ⚠️ You may ONLY edit the folder carrying YOUR OWN GitHub username. Touching anyone else's folder = auto-rejected. ⛔ NEVER edit .github/ workflows or scripts, index.html, sessions/, or README.md. Student PRs must touch ONLY your own folder (students/<NAME>-<ID>-<GithubUsername>/**) and optionally students.json. If you touch any other file, the bot will automatically reject your PR. ⚠️ Do NOT use git add . or git add -A. Always stage specifically: git add students/<NAME>-<ID>-<YourGithubUsername> students.json. ⚠️ If your PR shows a merge conflict, it will NOT be merged. Resolve it locally first, then push. Forgot the students.json line? Open the PR anyway - the bot adds the missing line to your branch itself (keep "Allow edits from maintainers" ticked, it is on by default) and re-checks.

Step 0 - one-time setup

# Fork this repo on GitHub (click Fork), then:
git clone https://github.com/<YOUR-USERNAME>/algorythm-iit-bhilai.git
cd algorythm-iit-bhilai
git remote add upstream https://github.com/<OWNER>/algorythm-iit-bhilai.git
git fetch upstream
git checkout main
git reset --hard upstream/main

Step 1 - ALWAYS create your own branch from updated main

git checkout main
git pull upstream main      # or: git fetch upstream && git reset --hard upstream/main
git checkout -b add-<NAME>-<ID>-<YourGithubUsername>
# Example: git checkout -b add-Swarnadip-12342210-Swarnadip-Kar

Rules:

  • Branch name must be add-<NAME>-<ID>-<YourGithubUsername> (same suffix as your folder). Keep your original case.
  • The username part MUST be YOUR OWN GitHub username (case-insensitive match with the PR author). You cannot open a PR for someone else's folder.
  • Never commit directly to main. Never open a PR whose head branch is main/master - the bot rejects it.
  • One student = one branch = one PR.

Step 2 - create your folder + students.json line (automatic)

Run this from the repo root - it creates your folder from the template AND appends the exact JSON line:

python3 students/add-me.py --name YourName --id YourID --github YourGithubUsername
# Example: python3 students/add-me.py --name Swarnadip --id 12342210 --github Swarnadip-Kar

Rules:

  • Folder is created as <NAME>-<ID>-<GithubUsername> - keep your original case (no forced lowercase).
  • NAME = your real name: letters/numbers/_, start with letter, NO hyphens. ID = your roll no. / chosen ID: letters/numbers, NO hyphens. Last part = YOUR GitHub username (may contain hyphens).
  • Example: Swarnadip-12342210-Swarnadip-Kar → NAME=Swarnadip, ID=12342210, GithubUsername=Swarnadip-Kar. Keep ID stable forever.
  • Inside your folder: index.html is required (put your real name in <h1>/<title>). You may add style.css and images (total < 500 KB). Do NOT touch anyone else's folder - the bot checks the username part against YOUR login.

Prefer manual? cp -r students/_template students/<NAME>-<ID>-<YourGithubUsername> and hand-edit students.json - the entry must look exactly like this:

[
  {
    "name": "Swarnadip",
    "id": "12342210",
    "folder": "Swarnadip-12342210-Swarnadip-Kar",
    "page": "students/Swarnadip-12342210-Swarnadip-Kar/index.html",
    "github": "Swarnadip-Kar"
  }
]

Rules for the hand-written line:

  • folder MUST equal <name>-<id>-<github> exactly (case-sensitive).
  • page MUST equal students/<folder>/index.html.
  • github MUST equal YOUR GitHub username (matches the PR author, case-insensitive).
  • id + folder + github must be unique - no duplicates (same first name is fine; one folder per GitHub account).
  • Only ONE new entry per PR. Do not reformat the whole file.

Forgot the students.json line entirely? Open the PR anyway - the bot adds the missing line to your branch itself (keep "Allow edits from maintainers" ticked, it is on by default) and re-checks.

Edit students/<NAME>-<ID>-<GithubUsername>/index.html - make it beautiful. See students/_template/index.html and students/Swarnadip-12342210-Swarnadip-Kar/index.html. Your page is listed on the main hub (index.html) automatically from students.json.

Step 3 - commit + push your branch, open PR to main

⚠️ Important: Do NOT run git add . or git add -A. That will accidentally stage unrelated files (like root index.html, workflow files, or .DS_Store), which will fail CI validation. Explicitly add only your files:

git add students/<NAME>-<ID>-<YourGithubUsername> students.json
git status   # MUST show ONLY your folder + students.json (no .github/, no index.html)
git commit -m "add: <NAME>-<ID>-<YourGithubUsername> bio page"
git push -u origin add-<NAME>-<ID>-<YourGithubUsername>

Then on GitHub: Compare & pull request → base: upstream/main ← compare: <YOUR-USERNAME>:add-<NAME>-<ID>-<YourGithubUsername>.

PR title format (required for auto-merge):

add: <NAME>-<ID>-<GithubUsername>
# Example: add: Swarnadip-12342210-Swarnadip-Kar

PR body: write 1 line - your name + what your page has.

Step 4 - what the bot checks (auto-merge rules)

If your students.json line is missing, the bot adds it to your branch first (same format) and re-checks - so the most common mistake fixes itself.

The validate-and-automerge Action approves + squash-merges ONLY if ALL pass:

  1. Head branch is NOT main/master - must be add-<NAME>-<ID>-<GithubUsername>, and its username part MUST equal YOUR login (the PR author).
  2. Base branch is main.
  3. No merge conflicts (mergeable = clean). Conflicting PRs are rejected - see §2.
  4. Changed files = ONLY YOUR OWN students/<NAME>-<ID>-<GithubUsername>/** + students.json (nothing else - never .github/ workflows/scripts, never _template/, never index.html, never someone else's folder).
  5. students.json diff = exactly +1 entry, valid JSON, folder == name-id-github, page == students/<folder>/index.html, github == YOUR username, no duplicate id/folder/github-user.
  6. students/<NAME>-<ID>-<GithubUsername>/index.html exists, contains <html> + <h1>/<title> with your real name, < 500 KB, no secrets.
  7. For edits (updating your own bio later): students.json may stay untouched, but then you may ONLY touch files inside YOUR OWN already-listed folder. Same branch rule applies (update-<NAME>-<ID>-<GithubUsername>).

If any check fails, the bot posts a comment explaining what to fix. Fix on the SAME branch + push - the PR re-checks automatically. No need to open a new PR.


2. Merge conflicts - resolve locally first, then push (mandatory)

If your PR page shows “This branch has conflicts that must be resolved”, the bot will reject it and never merge it until YOU fix it. This almost always means someone else edited students.json before you (same lines).

Do NOT click “Resolve conflicts” on github.com for students.json unless you know JSON well - one stray comma breaks the whole site. Fix locally:

# on YOUR branch
git fetch upstream
git rebase upstream/main
# OR: git merge upstream/main
# Git will mark CONFLICT in students.json. Open it, keep BOTH entries (yours + theirs), remove <<<<<<< ======= >>>>>>> markers, ensure valid JSON.

# verify JSON is still valid:
python3 -c "import json; json.load(open('students.json')); print('JSON OK')"

# verify your entry + folder still correct:
python3 .github/scripts/validate.py --base upstream/main --head HEAD || true

git add students.json
git rebase --continue   # if you used rebase (or: git commit, if you used merge)
git push --force-with-lease   # after rebase; plain `git push` after merge

Then confirm on your PR page: “This branch has no conflicts” + green checks. The bot will auto-merge from there.

First-timer tip: always git pull upstream main / rebase right before you start Step 1 - most conflicts disappear if you start from fresh main.


3. For maintainers - sessions, Pages, repo settings

Add a session:

  1. Copy deck HTML into sessions/<new-session-id>/index.html (+ extras).
  2. Add one object to sessions.json (id/title/date/description/deck/files).
  3. Push to main - index.html picks it up automatically. No rebuild.

Hosting: primary live site is the Vercel project linked to this repo (auto-deploys main). GitHub Pages is also ON as a backup deploy of the same main - but share only the vercel.app link, since the shared *.github.io host shows a browser warning (flagged because of an unrelated demo project).

Branch protection (active): main requires the validate check + PR before merging (strict off so queued auto-merges complete). Admins can still push session decks directly. Auto-merge bot has contents:write + pull-requests:write and squash-merges compliant PRs.

Management notes (private, NOT in git): see ../management/ next to this repo - owner checklist, links, roll list. Never commit that folder.


Repo layout

algorythm-iit-bhilai/
  index.html            ← main hub (reads JSON, renders sessions + students)
  students.json         ← THE main file students append one line to
  sessions.json         ← slide-deck catalogue
  students/
    _template/index.html
    Swarnadip-12342210-Swarnadip-Kar/index.html   ← example
    <NAME>-<ID>-<GithubUsername>/index.html  ← yours (username MUST be yours)
  sessions/
    session-01-intro-explore/index.html (+ pdf/md/png)
    session-02-git-agents/index.html (+ …)
    session-02-1-git-recovery/index.html (+ …)
  .github/
    workflows/validate-and-automerge.yml
    workflows/pages.yml (backup host deploy)
    scripts/validate.py

About

ALGORYTHM IIT Bhilai — session slide decks + student bio pages hub (auto-merged PRs, GitHub Pages)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages