Skip to content

refactor: streamline lint results handling in GitHub Actions workflow… #306

refactor: streamline lint results handling in GitHub Actions workflow…

refactor: streamline lint results handling in GitHub Actions workflow… #306

Workflow file for this run

name: Lint
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
lint-gh-cli-readme:
name: Lint ./gh-cli/README.md
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Lint ./gh-cli/README.md
id: lint
run: |
set -o pipefail
node ./.github/scripts/lint-readme.js | tee lint-results.txt
- name: Post lint results to job summary
if: always()
run: |
echo "## Lint Results for ./gh-cli/README.md" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
if [ -f lint-results.txt ]; then
cat lint-results.txt >> "$GITHUB_STEP_SUMMARY"
else
echo "No results available" >> "$GITHUB_STEP_SUMMARY"
fi
echo '```' >> "$GITHUB_STEP_SUMMARY"
lint-scripts-readme:
name: Lint ./scripts/README.md
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Lint ./scripts/README.md
id: lint
run: |
set -o pipefail
node ./.github/scripts/lint-readme.js ./scripts '##' '# scripts' | tee lint-results.txt
- name: Post lint results to job summary
if: always()
run: |
echo "## Lint Results for ./scripts/README.md" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo '```' >> "$GITHUB_STEP_SUMMARY"
if [ -f lint-results.txt ]; then
cat lint-results.txt >> "$GITHUB_STEP_SUMMARY"
else
echo "No results available" >> "$GITHUB_STEP_SUMMARY"
fi
echo '```' >> "$GITHUB_STEP_SUMMARY"