-
Notifications
You must be signed in to change notification settings - Fork 7
35 lines (28 loc) · 913 Bytes
/
scripts_readme.yml
File metadata and controls
35 lines (28 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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