Skip to content

refactor: streamline lint results handling in GitHub Actions workflow#154

Merged
joshjohanning merged 1 commit intomainfrom
refactor-lint-workflow-for-forks
Feb 26, 2026
Merged

refactor: streamline lint results handling in GitHub Actions workflow#154
joshjohanning merged 1 commit intomainfrom
refactor-lint-workflow-for-forks

Conversation

@joshjohanning
Copy link
Owner

This pull request updates the linting workflow for README files by changing how lint results are handled and presented.

Before we posted a comment back to the PR, which was nice and great, but sadly this won't work with forks - duh.

Just using the status checks status themselves and the workflow job summary instead.

Copilot AI review requested due to automatic review settings February 26, 2026 22:51
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request refactors the README linting workflow to improve compatibility with forked repositories by replacing PR comment posting with GitHub Actions job summaries. The change removes the complex artifact upload/download mechanism and the separate post-results job, opting instead for a simpler approach that displays lint results directly in the workflow job summary.

Changes:

  • Removed artifact upload and download steps for lint results
  • Removed the post-results job that posted sticky PR comments
  • Added job summary steps to both lint-gh-cli-readme and lint-scripts-readme jobs to display results inline
  • Simplified lint result file naming from specific names to generic lint-results.txt
Comments suppressed due to low confidence (1)

.github/workflows/lint-readme.yml:55

  • The || true has been removed from the lint command, which means the step will now fail when the lint script exits with a non-zero status (when issues are found). However, the next step "Post lint results to job summary" depends on the lint results file being created.

The problem is that when the lint script fails (exit code 1 on line 205 of lint-readme.js), the entire step will fail and subsequent steps may not run as expected, even with if: always(). The set -o pipefail option will also cause the pipeline to fail if any command in the pipe fails.

Consider either:

  1. Keeping the || true to ensure the step completes successfully while still capturing the lint results, or
  2. Explicitly setting the step to continue on error using continue-on-error: true on the lint step, or
  3. Handling the exit code explicitly with a trap or by capturing it in a variable

The current implementation will prevent the job summary from being properly populated when lint errors are found.

          node ./.github/scripts/lint-readme.js ./scripts '##' '# scripts' | tee lint-results.txt

@joshjohanning joshjohanning force-pushed the refactor-lint-workflow-for-forks branch from ef3ac65 to 1c40150 Compare February 26, 2026 22:58
@joshjohanning joshjohanning merged commit 52ea053 into main Feb 26, 2026
12 checks passed
@joshjohanning joshjohanning deleted the refactor-lint-workflow-for-forks branch February 26, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants