Skip to content

Addressing last date error with RDRS script #36

Addressing last date error with RDRS script

Addressing last date error with RDRS script #36

name: Copy README.md on main Push
on:
push:
branches:
- main
workflow_dispatch:
jobs:
copy_readme:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Copy README.md
run: |
cp README.md ./scripts/
- name: Modify README.md
run: |
markdown_file="./scripts/README.md"
main_header="Available Datasets"
awk -v header="$main_header" '/^#/{p=($0==("# " header));if(p)print;next}p' "${markdown_file}" > temp.md && mv temp.md "${markdown_file}"
sed -i 's/\/scripts//' "${markdown_file}"
- name: Commit and push changes
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "actions@github.com"
git add ./scripts/README.md
git commit -m "Update README.md"
git push