Skip to content

Commit

Permalink
Add gh action checking README helptext update
Browse files Browse the repository at this point in the history
  • Loading branch information
asmacdo committed Jun 10, 2024
1 parent 42a7d45 commit 5ffe020
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
27 changes: 27 additions & 0 deletions .github/workflows/readme-updated.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Check README.md helptext

on:
push:
branches:
- main
pull_request:
branches: [main]

jobs:
check_script_and_diff:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install duct
run: |
pip install .
- name: Update README.md helptext
run: |
./.update-readme-help.sh
- name: Ensure no diff
run: |
git diff --exit-code
5 changes: 5 additions & 0 deletions .update-readme-help.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
duct --help > .help_content.txt
sed -i '/<\!--- BEGIN HELP -->/,/<\!--- END HELP -->/{//!d;}' README.md
sed -i '/<\!--- BEGIN HELP -->/r .help_content.txt' README.md
rm .help_content.txt
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ positional arguments:
command The command to execute.
inner_args Arguments for the command.

optional arguments:
options:
-h, --help show this help message and exit
--version show program's version number and exit
-p OUTPUT_PREFIX, --output-prefix OUTPUT_PREFIX
Expand Down

0 comments on commit 5ffe020

Please sign in to comment.