Update Documentations #1011
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: Update Documentations | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
ubuntu-local-verbose: | |
name: Update README | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Generate available flags and options | |
run: | | |
export START='<!--FLAGS:START-->' | |
export END='<!--FLAGS:END-->' | |
export OPTIONS="$(sh install.sh -h | sed 's/^/ /g')" | |
export OPTIONS="$(printf "%s\n\n%s\n\n%s" "$START" "$OPTIONS" "$END" | sed "s/\$/\\\\/g")" | |
export PATTERN='\n%s' | |
sed -i.bck -e "/<\!--FLAGS:START-->/,/<\!--FLAGS:END-->/ c\\$(printf "$PATTERN" "$OPTIONS")" README.md | |
sed -i.bck -e "/<\!--FLAGS:START-->/,/<\!--FLAGS:END-->/ s/\\\\$//g" README.md | |
- uses: EndBug/add-and-commit@v7 | |
with: | |
add: 'README.md' | |
default_author: github_actions | |
message: 'docs(readme): update available flags and options' |