Conversation
Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
check_run input to optionally disable GitHub Check Run creation
|
@copilot resolve conflicts |
…ature Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
Conflicts resolved in commit |
…n true/empty Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
check_run input to optionally disable GitHub Check Run creationcheck_run input variable
…r PR #230) Co-authored-by: lcollins <528874+lcollins@users.noreply.github.com>
check_run input variableThere was a problem hiding this comment.
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_runinput and six action outputs (conclusion + counts + check run URL), and emit them from the action at runtime. - Update CI workflow to set a step
idand echo all outputs for visibility. - Update dependencies and regenerate
dist/artifacts; add tests aroundcheck_runenable/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 thoughrunis now exported. This makes importingrunhave 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 bydist/index.js.
return updateRes.data.html_url || ''
}
}
run()
src/main.ts:49
- The annotations are grouped by level twice: once inside
getConclusion()and again inrun()to compute the per-level counts. SincegroupBywalks 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 forcore.setOutput(for bothcheck_run=falseandcheck_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.ymlneeded updating, but this PR also changes source (src/*), action metadata (action.yml), dependencies (package*.json), generateddist/*, 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.
Branch was behind master after PR #230 ("Add output variables") merged, causing a dirty merge state.
Changes
.github/workflows/test.yml— Addedid: checkstyleto 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, anddist/—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.