Skip to content

Commit

Permalink
Automate README.md Updates on PRs (sdr-enthusiasts#364)
Browse files Browse the repository at this point in the history
* Automate README.md updates on Changes

* Update Planefence Github path

* docs: add mustache template warning comment

* docs: update contributing.md

Update the contributing.md so that people are aware that the README is
dynamically generated.

---------

Co-authored-by: rickstaa <[email protected]>
  • Loading branch information
Phaeton and rickstaa committed Oct 27, 2023
1 parent be0ca3b commit d4b9c6e
Show file tree
Hide file tree
Showing 8 changed files with 392 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
documentation: readme.md
documentation: readme.mustache
images: plane_images.csv
ukraine: plane-alert-ukraine.csv
twitter: plane-alert-twitter.csv
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/update_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Update README.md for Changes

permissions:
contents: write # Allow action to write back changes to repository.

on:
push:
branches: ["main"]
paths:
- "plane-alert-db.csv"
- "plane-alert-ukraine.csv"
- "plane-alert-pia.csv"
- "plane_images.csv"
- "scripts/update_readme.py"

jobs:
updateREADME.md:
if: github.repository == 'sdr-enthusiasts/plane-alert-db' || ${{ vars.CREATE_DERIVATIVES }}
name: Update README.md documentation for Changes
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- run: pip install -r ./scripts/requirements.txt

- name: Update README.md for changes in the database files
run: python ./scripts/update_readme.py

- name: Commit README.md
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "refactor: update README.md documentation."
19 changes: 18 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,30 @@ Pull requests are the best way to propose changes to the codebase (we use [Githu
8. Issue that pull request!
9. Merge your feature branch into your own `main` branch, so you don't have to wait for the PR to be merged.

## Important Development Notes

### Database Updates

Refer to the [README](README.md) for details on contributing to the following main databases:

- [plane-alert-db.csv](plane-alert-db.csv)
- [plane-alert-pia.csv](plane-alert-pia.csv)
- [plane-alert-ukraine.csv](plane-alert-ukraine.csv)
- [plane_images.csv](plane_images.csv)

Please note that other databases are automatically generated via [GitHub Actions](https://github.com/sdr-enthusiasts/plane-alert-db/actions/workflows/create_db_derivatives.yaml) and should not be manually edited.

### Readme Update

The readme is dynamically generated through the [update_readme.yml](https://github.com/sdr-enthusiasts/plane-alert-db/actions/workflows/update_readme.yml) action using the mustache template language and the chevron parser. For any modifications, exclusively edit the [readme.mustache](readme.mustache) file.

## Keep your fork up to date

You can keep your fork, and thus your private Vercel instance up to date with the upstream using GitHubs' [Sync Fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork) button. You can also use the [pull](https://github.com/wei/pull) package created by [@wei](https://github.com/wei) to automate this process.

## Automatically create the derivative databases

As the [README](README.md) explains, this repository uses GitHub actions to create several derivative databases from the main databases. By default, to prevent conflicts, the [create_db_derivatives.yaml](.github/workflows/create_db_derivatives.yaml) action is disabled on forks. You can, however, set the `CREATE_DERIVATIVES` repository variable to `true` in your repository settings (see [the GitHub documentation](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository)) if you want to create the derivative database on your fork automatically.
As the [README](README.md) explains, this repository uses GitHub actions to create several derivative databases from the main databases. By default, to prevent conflicts, the [create_db_derivatives.yaml](.github/workflows/create_db_derivatives.yaml) action is disabled on forks. You can, however, set the `CREATE_DERIVATIVES` repository variable to `true` in your repository settings (see [the GitHub documentation](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository)) if you want to create the derivative database on your fork automatically.

> **Warning**
> If you enable the building of the derivative databases on your fork, please use a feature branch (e.g. `patch`) when creating pull requests to the main repository. This will prevent your PR from being flagged as `invalid` since commits made by the [create_db_derivatives.yaml](.github/workflows/create_db_derivatives.yaml) do not re-trigger the PR check actions. You can then merge your changes into your main branch without waiting for the PR to be merged.
Expand Down
88 changes: 48 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<!--
🚨 IMPORTANT NOTICE 🚨
This README is dynamically generated by the `update_readme.yml` action using the mustache template language and the chevron parser. To make changes, ONLY edit the `readme.mustache` file.
🚨 IMPORTANT NOTICE 🚨
-->

# plane-alert-db <!-- omit in toc -->

This project consists of lists of 'interesting' aircraft, formatted as CSV files. The list is designed to work with the excellent **<https://github.com/kx1t/docker-planefence>**.
This project consists of lists of 'interesting' aircraft, formatted as CSV files. The list is designed to work with the excellent **<https://github.com/sdr-enthusiasts/docker-planefence>**.

> **Warning**
> Please only suggest/make any changes to the [plane-alert-db.csv](plane-alert-db.csv), [plane-alert-pia.csv](plane-alert-pia.csv), [plane-alert-ukraine.csv](plane-alert-ukraine.csv) and [plane_images.csv](plane_images.csv) files on GitHub - all other files (except PIA) are generated from this file, and if you do not make your changes there, they will be overwritten and lost. Additionally, it is **not recommended** to edit the CSV files in Microsoft Excel, as Excel will attempt to "fix" some ICAO hexes and other fields. It's better to use a code editor such as VS Studio Code—you can access the web version of Code by pressing the period key . when viewing the file you wish to edit.
Expand All @@ -16,20 +24,20 @@ This project consists of lists of 'interesting' aircraft, formatted as CSV files

## Current Content

There currently are about **13340** unique aircraft in **55** categories found in this repository. This [Dashboard](https://lookerstudio.google.com/reporting/46ff4328-09d3-4e65-ab5a-bd2ba27a18fd/page/4taCC) contains details of the main list and the most recent additions.
There currently are about **13491** unique aircraft in **53** categories found in this repository. This [Dashboard](https://lookerstudio.google.com/reporting/46ff4328-09d3-4e65-ab5a-bd2ba27a18fd/page/4taCC) contains details of the main list and the most recent additions.
These aircraft are divided into four main databases:

- [plane-alert-db.csv](plane-alert-db.csv) - A list of interesting aircraft with tags, categories and links. (13242)
- [plane-alert-pia.csv](plane-alert-pia.csv): A list that contains PIA planes. (55)
- [plane-alert-db.csv](plane-alert-db.csv) - A list of interesting aircraft with tags, categories and links. (13459)
- [plane-alert-pia.csv](plane-alert-pia.csv): A list that contains PIA planes. (57)
- [plane-alert-ukraine.csv](plane-alert-ukraine.csv): A list with Ukrainian planes. (32)
- [plane_images.csv](plane_images.csv): A accompanying list that contains aircraft images. (10557)
- [plane_images.csv](plane_images.csv): A accompanying list that contains aircraft images. (10844)

Based on these main databases, several derivative databases are created using a [GitHub action](https://github.com/sdr-enthusiasts/plane-alert-db/actions/workflows/create_db_derivatives.yaml):

- [plane-alert-civ.csv](plane-alert-civ.csv) - Civilian Registered Aircraft, includes Historic and Distinctive. (3310)
- [plane-alert-mil.csv](plane-alert-mil.csv) - Military Only. (7065)
- [plane-alert-pol.csv](plane-alert-pol.csv) - Police Forces. (862)
- [plane-alert-gov.csv](plane-alert-gov.csv) - Governments, Gov Agencies and Dictators. (1590)
- [plane-alert-civ.csv](plane-alert-civ.csv) - Civilian Registered Aircraft, includes Historic and Distinctive. (3599)
- [plane-alert-mil.csv](plane-alert-mil.csv) - Military Only. (7339)
- [plane-alert-pol.csv](plane-alert-pol.csv) - Police Forces. (902)
- [plane-alert-gov.csv](plane-alert-gov.csv) - Governments, Gov Agencies and Dictators. (1619)

A second version of each of the above lists contains up to 4 image links per aircraft. These lists are created in [GitHub action](https://github.com/sdr-enthusiasts/plane-alert-db/actions/workflows/create_db_derivatives.yaml) using the [plane_images.csv](plane_images.csv) database. **Please consider this experimental, do not come to rely on any of the image links**

Expand All @@ -40,59 +48,59 @@ A second version of each of the above lists contains up to 4 image links per air
- [plane-alert-pol-images.csv](plane-alert-pol-images.csv)
- [plane-alert-gov-images.csv](plane-alert-gov-images.csv)

Note, we used to create a seperate list, `plane-alert-twitter-blocked.csv`, for use with Planefence's Twitter posting functionality. This list would prevent certain aircraft from being posted to Twitter in an attempt to keep the posting bot account from being banned. Since Twitter has now made it all but impossible for users to make bots for free, we've stopped creating this list.
Note, we used to create a seperate list, `plane-alert-twitter-blocked.csv`, for use with Planefence's Twitter posting functionality. This list would prevent certain aircraft from being posted to Twitter in an attempt to keep the posting bot account from being banned. Since Twitter has now made it all but impossible for users to make bots for free, we've stopped creating this list.

This [Dashboard](https://lookerstudio.google.com/reporting/46ff4328-09d3-4e65-ab5a-bd2ba27a18fd) contains details of the [main](https://github.com/sdr-enthusiasts/plane-alert-db/blob/main/plane-alert-db.csv) and [Ukraine](https://github.com/sdr-enthusiasts/plane-alert-db/blob/main/plane-alert-ukraine.csv) lists.

## Description of Categories

Think of categories like groups, with similar or related aircraft listed together. This allows you to easily select a subset of the list for your own use. The category names (and tags) come from my rather idiosyncratic sense of humour. If you have better suggestions I'm all ears.

- Aerobatic Teams - Red Arrows, Blue Angels etc. (65)
- Aerobatic Teams - Red Arrows, Blue Angels etc. (77)
- Army Air Corp - UK Army Air Corp. Mainly Helicopters (94)
- As Seen on TV - Companies and Brands (368)
- As Seen on TV - Companies and Brands (367)
- Big Hello - Large Helicopters (sic) (104)
- Bizjets - Fancy pants planes for fancy pants people (38)
- Climate Crisis - Oil Companies, Large Business Jets - BBJs and ACJs (169)
- Coastguard - Coastguard, Customs and Border Patrols (434)
- Bizjets - Fancy pants planes for fancy pants people (39)
- Climate Crisis - Oil Companies, Large Business Jets - BBJs and ACJs (186)
- Coastguard - Coastguard, Customs and Border Patrols (438)
- Da Comrade - Russian or Soviet Aircraft. I love their design, so they get their own category (91)
- Dictator Alert - People of potentially questionable morals and values (322)
- Distinctive - Unique and/or special aircraft e.g. The AN-225 Myria, NASA aircraft, Testbeds (178)
- Dogs with Jobs - Aircraft with specific roles and/or modifications (163)
- Don't you know who I am? - Famous People. I was going to say notable, but I'll go with Famous (21)
- Flying Doctors - Air Ambulance and Medical Flights (658)
- Football - Actual, Aussie Rules or American. We don't discriminate. (2)
- GAF - Aircraft of the German Air Force, thank to Rhodan76 (401)
- Dictator Alert - People of potentially questionable morals and values (323)
- Distinctive - Unique and/or special aircraft e.g. The AN-225 Myria, NASA aircraft, Testbeds (182)
- Dogs with Jobs - Aircraft with specific roles and/or modifications (170)
- Don't you know who I am? - Famous People. I was going to say notable, but I'll go with Famous (59)
- Flying Doctors - Air Ambulance and Medical Flights (726)
- Football - Actual, Aussie Rules or American. We don't discriminate. (6)
- GAF - Aircraft of the German Air Force, thank to Rhodan76 (402)
- Gas Bags - Would you like to ride in my beautiful balloon? (14)
- Governments - Aircraft registered to Governments (237)
- Gunship - Brrrrrrrrrrrrrrrrrrrt (256)
- Hired Gun - Why do the dirty work when someone else can do it for you? (135)
- Historic - It's older than I am and most likely has a prop. (355)
- Governments - Aircraft registered to Governments (243)
- Gunship - Brrrrrrrrrrrrrrrrrrrt (257)
- Hired Gun - Why do the dirty work when someone else can do it for you? (195)
- Historic - It's older than I am and most likely has a prop. (394)
- Jesus he Knows me - Aircraft owned and operated by Religious organisations (20)
- Joe Cool - Cool Planes. Or at least I think they are cool. (197)
- Joe Cool - Cool Planes. Or at least I think they are cool. (195)
- Jump Johnny Jump - de Havilland Chipmunks. Air Cadets of a certain age will understand. (388)
- Nuclear - Nuclear Emergency Support Team etc. (16)
- Oligarch - I made this money all by myself. (41)
- Other Air Forces - Air Force aircraft that are not RAF or USAF (1991)
- Other Navies - Navy Aircraft that are not Royal Navy Fleet Air Arm or United States Navy (188)
- Oxcart - Intelligence gathering aircraft (687)
- Other Air Forces - Air Force aircraft that are not RAF or USAF (1974)
- Other Navies - Navy Aircraft that are not Royal Navy Fleet Air Arm or United States Navy (189)
- Oxcart - Intelligence gathering aircraft (736)
- Perfectly Serviceable Aircraft - Why do you keep jumping out of a Perfectly Serviceable Aircraft aka Skydiving planes (43)
- PIA - Privacy ICAO Address....you can run, but you cannot hide (16)
- Police Forces - Your friendly neighbourhood flying (insert local colloquialism here) (845)
- Ptolemy would be proud - Mapping and Aerial Survey aircraft. (110)
- Police Forces - Your friendly neighbourhood flying (insert local colloquialism here) (885)
- Ptolemy would be proud - Mapping and Aerial Survey aircraft. (111)
- Quango - Nato, United Nations, World Bank etc. (32)
- Radiohead - Very Very special aircraft. Think VC25. (6)
- RAF - Aircraft of the Royal Air Force (229)
- RAF - Aircraft of the Royal Air Force (231)
- Royal Aircraft - Aircraft used or owned by the UK Royal Family (8)
- Royal Navy Fleet Air Arm - Aircraft of the Royal Navy Fleet Air Arm (97)
- Sam Tân - Firefighting Aircraft. (301)
- Special Forces - The best of the best of the best. Sir. (161)
- Toy Soldiers - Armies from around the world (553)
- UAV - It's not natural, I tell 'ya (21)
- Sam Tân - Firefighting Aircraft. (326)
- Special Forces - The best of the best of the best. Sir. (163)
- Toy Soldiers - Armies from around the world (621)
- UAV - It's not natural, I tell 'ya (30)
- UK National Police Air Service - Your friendly neighbourhood flying bobby (24)
- United States Navy - United States naval avaitors. Some say they are the best of the best. (243)
- USAF - Aircraft of the United States Air Force (2138)
- Vanity Plate - Distinctive registrations (66)
- United States Navy - United States naval avaitors. Some say they are the best of the best. (168)
- USAF - Aircraft of the United States Air Force (2183)
- Vanity Plate - Distinctive registrations (78)
- Watch Me Fly - Flying and Training Schools (75)
- You came here in that thing? - Microlights, tiny planes and helis..think Yakima Super Breezy (thanks skstrand). (98)
- Zoomies - Fast jets, fighters. Anything that moves fast. (134)
Expand Down
Loading

0 comments on commit d4b9c6e

Please sign in to comment.