Skip to content

Merge remote-tracking branch 'source/v1.2' into v1.2 #46

Merge remote-tracking branch 'source/v1.2' into v1.2

Merge remote-tracking branch 'source/v1.2' into v1.2 #46

Workflow file for this run

name: Combine Markdown Files
on:
push:
branches:
- v1.2
jobs:
combine-md-files:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
token: ${{ secrets.PAT_TOKEN }}
fetch-depth: 0
- name: Combine .md files
run: |
find . -type f -name "*.md" \
-not -path "./docs/reference/*" \
-not -path "./docs/Archive/*" \
-not -path "./docs/Smart Contract Reference/*" \
-not -path "./reference/*" \
-not -path "./docs/Ecosystem/*" \
-not -name "combined.md" \
-not -name "combined.md.yml" \
-exec sh -c '
perl -0777 -ne '\''
if (/^---\n.*?title: (.*?)[\n].*?---\n(.*)/s) {
print "# $1\n$2\n\n";
}
'\'' "$1"
' sh {} \; > combined.md
- name: Commit and push changes
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add combined.md
git commit -m "Update combined.md [skip ci]" || echo "No changes to commit"
git push "https://${{ secrets.PAT_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" v1.2