feat(l1): don't log an error if we have no node config file when reading known peers #2375
This file contains hidden or 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: Check CLI Help Consistency | |
on: | |
pull_request: | |
paths: | |
- "cmd/ethrex/**" | |
- "docs/CLI.md" | |
- ".github/workflows/pr_lint_readme.yaml" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
# Remember to update the triggers whenever this path changes | |
MDFILE_WITH_CLI_HELP: docs/CLI.md | |
jobs: | |
check-cli-help: | |
name: Verify CLI Help Consistency | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Setup Rust Environment | |
uses: ./.github/actions/setup-rust | |
- name: Build ethrex binary | |
run: cargo build --bin ethrex | |
- name: Generate current CLI help | |
id: generate_help | |
run: cargo run --bin ethrex -- --help > current_help.txt | |
- name: Extract documented CLI help from documentation | |
id: extract_help | |
run: | | |
# Extract content between markers, remove markers, remove code block fences | |
sed -n '/<!-- BEGIN_CLI_HELP -->/,/<!-- END_CLI_HELP -->/p' ${{env.MDFILE_WITH_CLI_HELP}} \ | |
| sed '1d;$d' \ | |
| sed '/^```/d' \ | |
> documented_help.txt | |
# Check if extraction was successful (simple check: file not empty) | |
if [ ! -s documented_help.txt ]; then | |
echo "::error::Could not extract CLI help section from ${{env.MDFILE_WITH_CLI_HELP}}. Check markers <!-- BEGIN_CLI_HELP --> and <!-- END_CLI_HELP -->." | |
exit 1 | |
fi | |
- name: Compare current help with documented help | |
run: | | |
# Use diff with flags: | |
# -u: unified format (standard) | |
# -b: ignore changes in amount of whitespace | |
# -B: ignore changes whose lines are all blank | |
# This makes the check less sensitive to minor formatting differences. | |
if ! diff -ubB documented_help.txt current_help.txt; then | |
echo "::error::CLI help in ${{env.MDFILE_WITH_CLI_HELP}} is out of date." | |
echo "Please run 'cargo run --bin ethrex -- --help', copy the output," | |
echo "and update the section between <!-- BEGIN_CLI_HELP --> and <!-- END_CLI_HELP --> in ${{env.MDFILE_WITH_CLI_HELP}}." | |
echo "(Ignoring differences in spacing and blank lines)." | |
exit 1 | |
else | |
echo "${{env.MDFILE_WITH_CLI_HELP}} CLI help is up to date." | |
fi |