Skip to content

Commit 3a0e143

Browse files
committed
update README from json
These changes will update the README from json file using github actions. The JSON file becomes the source of data for the README. The README will be updated automatically when the JSON file is updated. The JSON file will be used to generate the README file using a python script. The python script will be run using github actions. The github actions will be triggered on push to the main branch. The README file will be committed to the main branch. The commit message will be "update README from json". The commit will be pushed to the main branch.
1 parent abe48d4 commit 3a0e143

8 files changed

+1445
-51
lines changed

.github/workflows/check_new_entry.yml

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Check JSON Entries
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- "awesome_open_geoscience.json"
9+
pull_request:
10+
paths:
11+
- "awesome_open_geoscience.json"
12+
workflow_dispatch:
13+
14+
jobs:
15+
check-entries:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v4
23+
with:
24+
python-version: "3.10"
25+
26+
- name: Install dependencies
27+
run: pip install jsonschema
28+
29+
- name: Validate JSON Entries
30+
run: |
31+
python scripts/validate_json_entries.py awesome_open_geoscience.json

.github/workflows/update_readme.yml

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update README from JSON
2+
# This workflow automatically updates the README file whenever the JSON file or the script changes.
3+
on:
4+
push:
5+
paths:
6+
- "awesome_open_geoscience.json" # JSON file in root directory
7+
- "scripts/json_to_readme.py" # Python script
8+
- "scripts/order.txt" # Order file
9+
- "media/**" # Anything in 'media' folder
10+
workflow_dispatch: # Allows manual triggering in GitHub Actions UI
11+
schedule:
12+
- cron: "0 0 * * 0" # Weekly on Sundays at midnight UTC
13+
14+
jobs:
15+
update-readme:
16+
runs-on: ubuntu-latest
17+
# Grant write permissions to the GITHUB_TOKEN
18+
permissions:
19+
contents: write
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
fetch-depth: 0
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: "3.10"
30+
31+
- name: Install dependencies
32+
run: pip install pyyaml
33+
34+
- name: Generate README
35+
run: python scripts/json_to_readme.py awesome_open_geoscience.json scripts/order.txt
36+
37+
- name: Check for changes
38+
id: git-check
39+
run: |
40+
git diff --quiet README.md || echo "changes=true" >> $GITHUB_OUTPUT
41+
42+
- name: Commit and push changes
43+
if: steps.git-check.outputs.changes == 'true'
44+
run: |
45+
git config --global user.name "github-actions[bot]"
46+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
47+
git add README.md
48+
git commit -m "Auto-update README from JSON [skip ci]" || echo "No changes to commit"
49+
# Use GITHUB_TOKEN for authentication
50+
git push "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" HEAD:main

.lycheeignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fsoftwareunderground%2Fawesome-open-geoscience
22
https://geoscience.data.qld.gov.au
33
https://opensource.org/license/lgpl-license-html
4-
https://opensource.org/licenses/gpl-license
4+
https://opensource.org/licenses/gpl-license
55
https://reproducibility.org/wiki/Installation
66
https://wiki.seg.org/wiki/Open_data
77
https://www.gnu.org/licenses/license-list.html#NonFreeDocumentationLicenses
@@ -16,3 +16,4 @@ http://www.fsf.org/licensing/licenses/
1616
https://www.fsf.org/licensing/licenses/
1717
https://www.gnu.org/licenses/
1818
http://www.gnu.org/licenses/
19+
https://researchportal.hw.ac.uk/en/datasets/costa-model-hierarchical-carbonate-reservoir-benchmarking-case-st

README.md

+89-50
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)