Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WFLY-18925: Flattened Quickstart READMEs #854

Merged
merged 1 commit into from
Jan 24, 2024
Merged
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
45 changes: 45 additions & 0 deletions .github/workflows/reduce_readme.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: WildFly Quickstarts Reduce READMEs

on:
push:
branches:
- main

# Only run the latest job
concurrency:
group: '${{ github.workflow }} @ ${{ github.ref || github.run_id }}'
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install Asciidoctor Reducer
run: sudo gem install asciidoctor-reducer
- name: Reduce README
run: |
CURRENT_DIR="$( pwd -P)"
#Get a list of subdirectories that don't start with a .
subdirs=`find . -maxdepth 1 -type d ! -iname ".*"`
#Loop over the subdirectories
for subdir in $subdirs
do
cd $subdir
#Check if the directory contains README-source.adoc
if [ -e README-source.adoc ]
then
#Get the dirname to define artifactId in the adoc
ARTIFACT_ID=":artifactId: $(basename `pwd`)"
#Use asciidoctor-reducer to create a flattened README.adoc
asciidoctor-reducer --preserve-conditionals -o README.adoc README-source.adoc
#Insert the directory name with env-github def so that this only affects GitHub rendering
sed -i "1s/^/ifdef::env-github[]\n$ARTIFACT_ID\nendif::[]\n\n/" README.adoc
fi
cd $CURRENT_DIR
done
- name: Commit and Push README
uses: EndBug/add-and-commit@v9
with:
add: '*.adoc'
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading