making workflow push work #5
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 ] | |
permissions: | |
contents: write | |
jobs: | |
merge-md: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Define file order | |
run: | | |
FILE_ORDER='[/index.md, /ssh.md]' > order.txt | |
- name: Read file order | |
run: | | |
ORDER=$(cat order.txt) | |
- name: Create initial README | |
run: echo '' > README.md | |
- name: Append each file in order | |
run: | | |
IFS=',' read -r -a files <<< "$ORDER" | |
for f in "${files[@]}"; do | |
cat "$f" >> README.md | |
echo "" >> README.md | |
done | |
- name: Commit changes | |
run: | | |
git config user.name "shoaib wani" | |
git config user.email "wanishoaib@protonmail.com" | |
git add README.md | |
git commit -m "Merge MD files in specified order" | |
git push -u https://pyloris:${{ secrets.GITHUB_TOKEN }}@github.com/Pyloris/linuxKing.git master |