Closed camposcristian closed 4 years ago
Hi @camposcristianeze, thanks for that question.
Do you have GITHUB_AUTH_TOKEN
environmental variable in you CI settings? The value should be the personal token (GitHub) for a user that has privileges to comment on the project.
Thanks for the answer @grgur . Realised that the comments were working, but they are appearing as commit comments. Any way to add them as comments on a PR instead?
This is our current action:
name: Pull Request Deploy
on:
pull_request:
branches:
- staging
- master
jobs:
gimbal:
runs-on: ubuntu-latest
steps:
- name: Check out the code
uses: actions/checkout@v1
with:
fetch-depth: 1
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install yarn dependencies
run: yarn
- name: Build
env:
CI: ''
run: yarn build
- name: Performance Budgeting Regression Testing
uses: ModusCreateOrg/gimbal/action@master
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GIMBAL_GITHUB_TOKEN }}
As of when the last publish of gimbal, GitHub actions does not provide the PR number so the only option is to use the commit sha and comment on that commit. I also feel it has value to comment the run result on the commit to connect the run and the log.
This being said, it is my experience that commenting on a commit will be displayed in the pull request view. For example all the commit comments on this PR: #159
That makes sense.. The thing is that comments are only appearing only in merges that I can't figure out where they are coming from.
🤔 Maybe because we set this for:
on:
pull_request:
branches:
- staging
- master
instead of
on: [push]
I'll have a look and let you know!
The issue with using the pull_request type is that it’s not going to run your workflow when you likely want it to. It will only run when a PR is opened or closed or when it’s edited like when you add a label or assign it to someone. You likely want gimbal to run when you push a commit which the pull_request type won’t get triggered akaik.
Hi @camposcristianeze! I'm curious, did @mitchellsimoens's suggestion work for you?
Got it working like a charm! Thanks @mitchellsimoens @grgur
Describe the bug For some reason, the comment in the PR of github is not appearing To Reproduce Steps to reproduce the behavior:
Expected behavior Log said that comment should appear but for some reason is not on the PR.
Screenshots![image](https://user-images.githubusercontent.com/1928706/79304993-821d4b80-7ec0-11ea-9fc9-78d608fede95.png)
Additional context Logs with verbose comments: