jwgmeligmeyling / checkstyle-github-action Goto Github PK
View Code? Open in Web Editor NEWPush Chekcstyle results as check run annotations
License: MIT License
Push Chekcstyle results as check run annotations
License: MIT License
Github Actions run within a Workflow Run. Each Workflow Run is associated with its own Check Suite. Whenever we post a Check Run, a Check Suite is created unless a Check Suite for that application already exists. However, when multiple workflows are triggered for an event (or multiple events trigger multiple runs of the same workflow) , multiple possible Check Runs will be available. Unfortunately, there is no way for us to pick a Check Suite when creating a new Check Run. This is a limitation in the Github Checks API. As a result, currently results generated during workflows on a pull_request
event might end up at the push
workflow, if both events are used together.
(The interesting part about this image is that the "build-test PMD" run was created during "build-test on: pull request".
See also: https://github.community/t/specify-check-suite-when-creating-a-checkrun/118380?u=jwgmeligmeyling
Copy of: jwgmeligmeyling/pmd-github-action#4
Does this should work for the maven pmd:cpd goal? look likes it is not. I hope you can clarify. Thanks
(sorry this is for your pmd-github-action not checkstyle...)
When working on a project in an enterprise github instance with a self-signed certificate, I get the following output.
Creating annotations for /home/runner/actions-runner/_work/demo-api/demo-api/build/reports/checkstyle/main.xml
Creating annotations for /home/runner/actions-runner/_work/demo-api/demo-api/build/reports/checkstyle/test.xml
Uploading 0 / 0 annotations to GitHub as Checkstyle with conclusion success
Error: HttpError: request to https://github.company.local/api/v3/repos/Organization/demo-api/commits/eebc1a4ba7aedc7000ae18a04d52207653c33eac/check-runs failed, reason: unable to verify the first certificate
So, the action does the first part fine, but when it attempts to communicate with the server, it gets this error.
The runner is a self-hosted runner on Ubuntu and the certificate for the github.company.local
address is installed under /etc/ssl/certs
. I have the following environment var set in the workflow
env:
SSL_CERT_DIR: "/etc/ssl/certs"
This gets picked up by the other actions like Java and the Gradle build that runs to produce the checkstyle reports.
I tried adding another environment variable for node:
NODE_EXTRA_CA_CERTS: "/etc/ssl/certs/wildcard.company.pem"
But to no avail.
Is there something I missed?
Since 3 days I get the following error, for all actions that runs in a pullrequest from another branch and not a fork: Error: HttpError: Resource not accessible by integration
log.txt
If a checkstyle report contains issues for files not modified in the PR, these issues are reported in the PR at the end, under a section "Unchanged files with check annotations ".
It would be great to be able to only annotate the files modified in the PR.
I have no idea if this is something that has to be done:
I open the issue here in case anything can be done about it here.
Great Github action btw! ๐
Right now this action adds a new check to report all annotations. Ideally I'd want to disable this behavior and just report annotations "normally" like other actions do.
For example, one of the linters I use is markdownlint and I enabled a problem matcher for that to create annotations. Another one is yutailang0119/action-android-lint that uses the GitHub actions toolkit to create the annotations from a Android XML file.
Hello,
thanks for your work
is it possible to failfast in case of at least one error in checkstyle
kind regards
To support the workflow_run use case it is necessary to specify the commit to upload annotations against.
Here is an example of an action that provides this capability: https://github.com/ScaCap/action-surefire-report and here is the relevant code https://github.com/ScaCap/action-surefire-report/blob/master/action.js#L28
const commit = core.getInput('commit');
...
const head_sha = commit || (pullRequest && pullRequest.head.sha) || github.context.sha;
...
const createCheckRequest = {
...github.context.repo,
name,
head_sha,
status,
conclusion,
output: {
title,
summary: '',
annotations: annotations.slice(0, 50)
}
};
Here is an example usage of this feature: https://github.com/apache/spark/blob/master/.github/workflows/test_report.yml#L24
I think this should be relatively straight forward to add to this action, and would impact this area of code:
https://github.com/jwgmeligmeyling/checkstyle-github-action/blob/master/src/main.ts#L98
let sha = context.sha
if (context.payload.pull_request) {
sha = context.payload.pull_request.head.sha
}
When building with jwgmeligmeyling/checkstyle-github-action
in workflow, the following warning is reported:
Node.js 12 actions are deprecated.
For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/.
Please update the following actions to use Node.js 16:jwgmeligmeyling/checkstyle-github-action
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.