Skip to content

Commit

Permalink
- ADDED: Plugin version updater workflow for documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mavproductions committed May 6, 2024
1 parent bf441b8 commit 03c2a86
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/plugin-versions-in-documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Compare and Update Markdown Files

on:
push:
paths:
- '*.md'

jobs:
compare_and_update:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v2

- name: Compare files
id: compare
run: |
# Get the content of the table starting with "Mod | Version | Developer | Why" from README.md
readme_table=$(awk '/Mod \| Version \| Developer \| Why/ {p=1; print} p && /^\s*$/ {exit}' README.md)
# Get the content of the corresponding table from /documentation/docs/Mods Included.md
mod_included_table=$(awk '/Mod \| Version \| Developer \| Why/ {p=1; print} p && /^\s*$/ {exit}' documentation/docs/Mods\ Included.md)
# Compare the tables
if [[ "$readme_table" != "$mod_included_table" ]]; then
echo "::set-output name=files_differ::true"
else
echo "::set-output name=files_differ::false"
fi
- name: Update files if needed
if: steps.compare.outputs.files_differ == 'true'
run: |
# Update /documentation/docs/Mods Included.md with content of README.md
cp README.md documentation/docs/Mods\ Included.md
git add documentation/docs/Mods\ Included.md
git commit -m "Update /documentation/docs/Mods Included.md with changes from README.md"
git push

0 comments on commit 03c2a86

Please sign in to comment.