Skip to content

Task to write build result to GitHub comment #10665

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

Closed
datapythonista opened this issue Jun 16, 2019 · 5 comments
Closed

Task to write build result to GitHub comment #10665

datapythonista opened this issue Jun 16, 2019 · 5 comments

Comments

@datapythonista
Copy link

Required Information

Entering this information will route you directly to the right team and expedite traction.

Question, Bug, or Feature?
Type: Feature

Enter Task Name: here

list here (V# not needed):
https://github.com/Microsoft/azure-pipelines-tasks/tree/master/Tasks

Environment

  • Server - Azure Pipelines or TFS on-premises?

    • If using TFS on-premises, provide the version:

    • If using Azure Pipelines, provide the account name, team project name, build definition name/build number: pandas-dev/pandas

  • Agent - Hosted or Private: Hosted

Issue Description

Once a PR is open, and after the CI runs, it would be nice to be able to post the result of the builds as a GitHub comment.

See for example here, how the GitHub application pep8speaks posts a comment with the result of their validations: pandas-dev/pandas#26894

Couldn't find a task for that, and it's not possible to write a custom script, since accessing the GitHub API directly would require an authentication token (PR builds can't access secret variables, so we can't store the token).

Is it possible to do this? Can it be implemented as a task?

@tarrenj
Copy link

tarrenj commented Sep 17, 2019

I'm currently trying to achieve this via a combination of DevOps pipelines and GitHub Actions. The downside is that the same build has to be run twice; GitHub Actions is currently free, so it's not an issue, but it may be in the future.

I haven't had any success yet, but I'll update here if I do.

Edit:
I haven't been able to get this approved by my admin, but you might have better luck: https://marketplace.visualstudio.com/items?itemName=SOUTHWORKS.github-pr-comment&ssr=false#overview

@thesattiraju
Copy link
Contributor

You could use this task: https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/GitHubCommentV0

@datapythonista
Copy link
Author

You could use this task: https://github.com/microsoft/azure-pipelines-tasks/tree/master/Tasks/GitHubCommentV0

That task doesn't have documentation, so it's difficult to tell for sure. But the task is to write a github comment, and that's not the main issue, the main issue is to access the results of all the jobs in the build.

@thesattiraju
Copy link
Contributor

The task takes the contents as an input. You could draft the contents of the jobs using output variables, in most of the cases I presume.

@mloskot
Copy link

mloskot commented Feb 17, 2023

Here it seems to be documented
https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/github-comment-v0

AFAIU, that task is available via Azure DevOps UI, see https://stackoverflow.com/a/66810491/151641

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants