:Merge remote-tracking branch 'refs/remotes/origin/master' #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Merge MD Files | |
on: | |
push: | |
branches: | |
- master # adjust the branch as needed | |
permissions: | |
contents: write | |
jobs: | |
merge_md_files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v2 | |
- name: Merge MD Files | |
run: | | |
# Define the order of markdown files to merge | |
files_to_merge=("index.md", "navigation.md", "files.md", "ssh.md", "sed.md", "searchingFiles.md") | |
# remove existing contents readme | |
echo '' > README.md | |
# Merge files in the specified order | |
for file in ${files_to_merge[@]}; do | |
cat ${file/%,/} >> README.md | |
echo "" >> README.md # Add a newline between files | |
done | |
- name: Commit and Push Changes | |
run: | | |
git config --global user.email "actions@github.com" | |
git config --global user.name "GitHub Actions" | |
git add README.md | |
git commit -m "Merge markdown files" | |
git pull | |
git push | |
git push -u https://pyloris:${{ secrets.GITHUB_TOKEN }}@github.com/Pyloris/linuxKing.git master |