-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to create annotations #133
Comments
Hi @xt0rted, I'm having trouble reproducing this issue, I've outlined my steps below in case they are helpful! I tried the following below: Here are the packages I am using:
Here is my action main.ts
Here is how I invoke the action
|
@thboop I'll have to take a look at this again later, but the main difference I see between the two setups is yours isn't creating annotations in the update call. I'm able to create the checks run just fine, but when it comes to the annotations that's when the request fails. |
@xt0rted |
@thboop this is embarrassing, the issue was on my end. I was setting the The issue I'm facing now is how to get the annotations to be associated with the job they ran in. In v1 I did this by using |
After some more testing I'm seeing that if the workflow runs on |
Hey @xt0rted I'm going to take this feedback to the team and see how we can improve this experience! Thanks for your feedback and quick responses on this item we really appreciate it! For now, you can use access the I will also file an item for the 422 response code you were seeing and see how we can improve that messaging and error handling. |
@bryanmacfarlane the annotations are working now, but I'm not sure how to associate them with the job that created them. This worked in v1 by using An example run can be seen here. The job |
Hey @xt0rted , Our recommended flow for this is going to be using problem matchers, as these will automatically create issues on the run. We have a feature in development which will create annotations for issues on your run, providing the end to end functionality I believe you are trying to accomplish. This should allow you to more easily create annotations without having to manually use the sdk to create another check! We have a ticket to update our documentation #56 which will cover how to do this. |
@thboop I'll give this a try and see how it works compared to the api approach. |
@thboop I forgot to ask, when creating annotations with the api you can add action buttons to them. The UI shows them and reacts to clicking them, but I wasn't able to get that to trigger a workflow on |
@xt0rted , that doesn't seem intended. Other users recently reported similar issues with triggering workflows from apps. I'll pass along that you are seeing this issue as well to our engineering team. You can also reply in the community forums. Just for clarity's sake, I do not think that issue is related to the toolkit. |
Sorry to hijack this thread as I am interesting in using the Checks API for a linting tool as a GitHub Action like you are @xt0rted With @xt0rted your example you have a new check run called Is the best way to create a brand new Check Run to do the annotations in or is it possible to use the same check run/suite that GitHub Actions is creating behind the scenes? With something like const checkList = await client.checks.listForRef({
owner: github.context.repo.owner,
repo: github.context.repo.repo,
ref: github.context.ref
});
console.log('checkList data', checkList.data);
// The Check Run ID to use to update it later on
const checkRunId = checkList.data.check_runs[0].id; Again this all seems like uncharted territory at the moment & would love some clarification please, to know what is the best/correct way to be creating/writing linters using GitHub Actions 😄 I would ❤️ if the GitHub Actions team ported/updated/created a new guide tutorial based on the Rubocop linter that is a GitHub App |
Hey @warrenbuckley I am hopeful you are going to be really happy with the new annotation features once they are ready! They are currently being worked on!
That being said, this doesn't cover all the feedback you provided. Feel free to create a discussion on the community forum or submit a feedback ticket if you a way to get the current job or check via the checks api would be useful to you! |
Closing per ^^ discussion. Let us know if there's something actionable in toolkit outside the items covered above and we can consider re-opening or another issue |
@thboop I switched one of my JS actions over to use a problem matcher. It'd be helpful if there was a function in the toolkit to facilitate registering them (they seem to still use |
@xt0rted , That feature is not quite ready yet, we will update the docs with more information when it is available! |
I have two actions that create annotations after running eslint & stylelint but I have yet to move them to v2. They run fine in v2 workflows though and annotations are created as you'd expect.
I'm trying to setup a new action that creates annotations just like my other actions but using the toolkit packages. I'm able to create a checks run using
GITHUB_TOKEN
and the github client, but I'm not able to call the update checks function with the annotations. I keep getting a 422 response back. Are there differences between v1 and v2 actions that would prevent this from working?This call works:
But this call doesn't:
The text was updated successfully, but these errors were encountered: