Skip to content

Add check_run input to optionally disable GitHub Check Run creation Add test cases for check_run#228

Merged
lcollins merged 6 commits intomasterfrom
copilot/validate-implementation-for-217
Mar 4, 2026
Merged

Add check_run input to optionally disable GitHub Check Run creation Add test cases for check_run#228
lcollins merged 6 commits intomasterfrom
copilot/validate-implementation-for-217

Conversation

Copy link

Copilot AI commented Mar 4, 2026

Branch was behind master after PR #230 ("Add output variables") merged, causing a dirty merge state.

Changes

  • .github/workflows/test.yml — Added id: checkstyle to the action step and echo steps for all six output variables (conclusion, violations, failures, warnings, notices, check_href), matching master.

The branch already carried the correct merged state for src/main.ts, src/constants.ts, action.yml, and dist/—only the workflow file required updating.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
Copilot AI changed the title [WIP] Validate implementation for issue 217 Add check_run input to optionally disable GitHub Check Run creation Mar 4, 2026
@lcollins
Copy link
Owner

lcollins commented Mar 4, 2026

@copilot resolve conflicts

…ature

Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
Copy link
Author

Copilot AI commented Mar 4, 2026

@copilot resolve conflicts

Conflicts resolved in commit 4d57f59. The branch now includes both the check_run input from this PR and the output variables (conclusion, violations, failures, warnings, notices, check_href) from master (PR #218). When check_run: false is set, check run creation is skipped but outputs (except check_href) are still populated.

…n true/empty

Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
Copilot AI changed the title Add check_run input to optionally disable GitHub Check Run creation Add test cases for check_run input variable Mar 4, 2026
…r PR #230)

Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
Copilot AI changed the title Add test cases for check_run input variable Resolve conflicts with master: sync test workflow output echo steps Mar 4, 2026
@lcollins lcollins marked this pull request as ready for review March 4, 2026 22:43
Copilot AI review requested due to automatic review settings March 4, 2026 22:43
@lcollins lcollins changed the title Resolve conflicts with master: sync test workflow output echo steps Add check_run input to optionally disable GitHub Check Run creation Add test cases for check_run Mar 4, 2026
Copy link

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 PR syncs the branch with changes that landed on master (notably adding action output variables and workflow echo steps), and includes the corresponding implementation, metadata, and build artifacts needed to expose those outputs.

Changes:

  • Add check_run input and six action outputs (conclusion + counts + check run URL), and emit them from the action at runtime.
  • Update CI workflow to set a step id and echo all outputs for visibility.
  • Update dependencies and regenerate dist/ artifacts; add tests around check_run enable/disable behavior.

Reviewed changes

Copilot reviewed 6 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/main.ts Adds check_run toggle, computes per-level counts, emits outputs, and returns html_url from check runs.
src/constants.ts Introduces Inputs.CheckRun and Outputs enum keys used by the action.
action.yml Declares new check_run input and the six outputs for downstream workflow consumption.
__tests__/check-run.test.ts Adds Jest coverage for skipping/creating check runs based on check_run.
.github/workflows/test.yml Adds step id: checkstyle and echo steps for each output in CI.
package.json Bumps fast-xml-parser version.
package-lock.json Updates lockfile to reflect dependency resolution changes.
dist/index.js Regenerated bundled action output (includes new runtime behavior and dependency updates).
dist/licenses.txt Regenerated dependency license bundle metadata.
Comments suppressed due to low confidence (4)

src/main.ts:180

  • run() is still invoked at module load (bottom of file) even though run is now exported. This makes importing run have side effects (and can break/flake tests) because the action executes immediately on import. Consider guarding the call (e.g., only run when this file is the entrypoint) or moving the top-level invocation into a dedicated entrypoint module used by dist/index.js.
    return updateRes.data.html_url || ''
  }
}

run()

src/main.ts:49

  • The annotations are grouped by level twice: once inside getConclusion() and again in run() to compute the per-level counts. Since groupBy walks the full annotation list, consider computing this once and reusing it for both the conclusion and the output counts to avoid redundant work on large reports.
      const conclusion = getConclusion(annotations)

      const annotationsByLevel: {[p: string]: Annotation[]} = groupBy(
        a => a.annotation_level,
        annotations
      )

src/main.ts:83

  • New outputs are set here (including check_href), but the added Jest tests only assert whether the check run was created/skipped and never validate the output values. Adding assertions for core.setOutput (for both check_run=false and check_run=true) would better lock in the contract and prevent regressions in output names/values.
      core.setOutput(Outputs.Conclusion, conclusion)
      core.setOutput(Outputs.Violations, annotations.length)
      core.setOutput(Outputs.Failures, numFailures)
      core.setOutput(Outputs.Warnings, numWarnings)
      core.setOutput(Outputs.Notices, numNotices)
      core.setOutput(Outputs.CheckHref, checkHref)

.github/workflows/test.yml:49

  • PR description says only .github/workflows/test.yml needed updating, but this PR also changes source (src/*), action metadata (action.yml), dependencies (package*.json), generated dist/*, and adds tests. Please update the PR description to reflect the actual scope (or split the extra changes) so reviewers know what is being merged.
        id: checkstyle
        with:
          path: '**/checkstyle-result.xml'
      - run: echo "conclusion=${{ steps.checkstyle.outputs.conclusion }}"
      - run: echo "violations=${{ steps.checkstyle.outputs.violations }}"
      - run: echo "failures=${{ steps.checkstyle.outputs.failures }}"
      - run: echo "warnings=${{ steps.checkstyle.outputs.warnings }}"
      - run: echo "notices=${{ steps.checkstyle.outputs.notices }}"
      - run: echo "check_href=${{ steps.checkstyle.outputs.check_href }}"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lcollins lcollins merged commit b18e721 into master Mar 4, 2026
4 of 5 checks passed
@lcollins lcollins deleted the copilot/validate-implementation-for-217 branch March 4, 2026 22:57
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.

3 participants