-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
Comment Job execution link as a comment to the PR #211
Comments
cc @mattn |
Interesting. Could you please send me PR to modify README ? |
I recommend you to enable "Leave comments?" options on coveralls, instead of adding "Create or update comment" step. e.g. the setting for https://github.com/shogo82148/actions-goveralls is available on https://coveralls.io/github/shogo82148/actions-goveralls/settings: The example of coveralls' comments is here: shogo82148/actions-goveralls#352 (comment) |
Or you want to do this in your GitHub Actions workflow, you should use The "Send coverage" will be: goveralls -coverprofile=covprofile -service=github 2> code_coverage_link
coverage="$(cat code_coverage_link)"
echo "::set-output name=coverage::$coverage" |
Thanks for your help :) The settings on https://coveralls.io/github/<user/org>//settings are already configured. The comment does not appear tho. Do you know what could be missing? Coveralls has granted access |
okay I figured it out.. I will open a PR soon to update the README. The problem is that passing a multi line string through github action outputs is a bit weird,, (see article) This version works for me now :) - name: Send coverage
id: send-coverage
env:
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CODE_COVERAGE_LINK=$(goveralls -coverprofile=covprofile -service=github)
coverage=$(echo $CODE_COVERAGE_LINK)
echo "::set-output name=coverage::$coverage"
- name: Find Comment
uses: peter-evans/find-comment@v2
id: fc
with:
token: ${{secrets.GOVERNANCE_BOT_TOKEN}}
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'carbonautMustache'
body-includes: Code coverage link
- name: Create or update comment
uses: peter-evans/create-or-update-comment@v2
with:
token: ${{secrets.GOVERNANCE_BOT_TOKEN}}
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Code coverage link: ${{ steps.send-coverage.outputs.coverage }}
edit-mode: replace |
Hi 👋
Great Action! Thanks :)
I integrated it to my workflow and it works great. I am trying to comment into the PR chat the link to the codecoverage website. Maybe this could be a nice addition for this too.
Code except
I am unable to retrieve the link and only get this output: 'Code coverage link: Job #2250989753.1' no idea how to get the website link.. I looked into the API defenition but could find a way to http request it.
The link is printed to the action execution but I am unable to store it in a variable..
Any ideas? Thanks!
I am happy to document this in this repo's readme if that's interesting
Cheers Leo
The text was updated successfully, but these errors were encountered: