Skip to content
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

Requirement for token when using github api for custom actions. #445

Closed
Tylertron1998 opened this issue May 5, 2020 · 3 comments
Closed
Labels
enhancement New feature or request

Comments

@Tylertron1998
Copy link

Describe the enhancement
The current requirement for a token to use annotations is a little strange. I'm currently building a custom action and asking users to give me a token so I can put annotations on pull requests based on the action result is something I'd rather not do - to anyone with a little less understanding, this could seem a little nefarious.

What I'd like to see is a way to be able to post annotations for the current action run in the context it's run in - i.e. if a pull request triggers my-cool-action@v1 then my-cool-action@v1 should be able to add annotations for that pull request and only that pull request.

Additional information
For some strange reason, I can see that running dotnet build gives annotations - which is confusing as dotnet build certainly does not integrate with github, and even more confusingly doesn't seem to require an api key.

@Tylertron1998 Tylertron1998 added the enhancement New feature or request label May 5, 2020
@thboop
Copy link
Collaborator

thboop commented May 6, 2020

Hey @Tylertron1998 , I'd like to understand your use case a little better. I've tried to outline the options available to you below!

For some strange reason, I can see that running dotnet build gives annotations

This is likely being done via Problem Matchers. Do you run a setup-action like setup-dotnet that registers a problem matcher automatically?

You shouldn't need @actions/github to create annotations. We also support the following, which do not require a token.

  • If you are trying to create annotations from structured output (such as compile output), you can register a problem matcher, as outlined in the documentation above.
  • You may also choose to create annotations via the error and warning functions in @actions/core.

We also have an open issue to see how we can improve this experience outside of the warning and error functions: #186

@Tylertron1998
Copy link
Author

Interesting - I had no idea about problem matchers! I'll check them out!

@thboop
Copy link
Collaborator

thboop commented May 13, 2020

I'm going to close this ticket for now, but if you have any more questions or feedback after checking it out please let me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants