Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/generate-readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Autogenerate README

on:
pull_request:
paths:
- .utils/generate_readme.py
- .github/workflows/generate-readme.yml

jobs:
generate-readme:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r .utils/requirements.txt || true

- name: Generate README
run: python .utils/generate_readme.py

- name: Check for uncommitted README changes
run: |
git add README.md
git diff --cached --exit-code || {
echo "::error::README.md is out of date or modified manually. Please re-run the generate_readme script and commit the result.";
exit 1;
}
2 changes: 1 addition & 1 deletion .utils/generate_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def extract_metadata(readme_path):
metadata = yaml.safe_load(match.group(1))
except yaml.YAMLError as e:
print("Error parsing YAML metadata in", readme_path, ":", e)
return None
raise e

return metadata

Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ To contribute a tutorial, please follow these steps:
- `blog_post_url` - the url to blog post (optional)
- `video_url` - the url to the video (optional)
- `visualize_url` - the url to Foxglove visualization (optional)

When creating a merge request, a GitHub action should automatically regenerate the README based on your metadata. To test it yourself, you can run the python script `.utils/generate_readme.py` in the root of this repo.
4. Regenerate the main README.md by running `python .utils/generate_readme.py` from the root of the repo (install `.utils/requirements.txt` if needed).
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ Below is a list of all tutorials available in this repository:
### [Foxglove Visualization for 1X World Model Challenge](datasets/1x_eve/README.md)
- 📝 Use Foxglove to visualize 1X World Model Challenge
- 🎥 [Video](https://www.youtube.com/watch?v=A9wl491ltPA)
### [Convert .mat files to MCAP](datasets/NASA_mat_to_MCAP/README.md)
- 📝 Visualize Matlab files for NASA Valkyrie box pickup task
### [Converting Argoverse 2 Dataset to MCAP](datasets/foxglove_av2_tutorial/README.md)
- 📝 This example converts the LiDAR scans from an AV2 log to MCAP.
- 🎥 [Video](https://youtu.be/tBj1LrL1v18)
Expand Down Expand Up @@ -85,4 +83,4 @@ Below is a list of all tutorials available in this repository:
- 📝 Load and analyze data in Jupyter Notebooks using Foxglove Data Management
- 🔗 [Related Blog Post](https://foxglove.dev/blog/analyze-your-robotics-data-with-jupyter-notebooks)

Join the Foxglove [Discord](https://discord.gg/UEuytgVkks) and follow [our blog](https://foxglove.dev/blog) for more ideas on how to integrate Foxglove into your robotics development workflows.
Join the Foxglove [Discord](https://discord.gg/UEuytgVkks) and follow [our blog](https://foxglove.dev/blog) for more ideas on how to integrate Foxglove into your robotics development workflows.
Loading