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

Comment checkdiff output on PRs #1548

Closed
wants to merge 1 commit into from

Conversation

Rangi42
Copy link
Contributor

@Rangi42 Rangi42 commented Oct 22, 2024

No description provided.

@Rangi42 Rangi42 added the meta This isn't related to the tools directly: repo organization, maintainership... label Oct 22, 2024
@Rangi42
Copy link
Contributor Author

Rangi42 commented Oct 22, 2024

@ISSOtm You mentioned this would be a nice feature; can you look into why it's failing with 403?

Copy link
Member

@ISSOtm ISSOtm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm guessing that the 403 might be stemming from the wrong endpoint being used? IDRK, this is just a guess. (I used https://octokit.github.io/rest.js/v21/#pulls-create-review as a reference.)

Comment on lines +20 to +30
make checkdiff "BASE_REF=${{ github.event.pull_request.base.sha }}" | tee log
- name: Comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Checkdiff:** <pre><code>${{steps.checkdiff.outputs.response}}</code></pre>`
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
make checkdiff "BASE_REF=${{ github.event.pull_request.base.sha }}" | tee log
- name: Comment
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Checkdiff:** <pre><code>${{steps.checkdiff.outputs.response}}</code></pre>`
})
make checkdiff "BASE_REF=${{ github.event.pull_request.base.sha }}"
- name: Comment
if: ${{ failure() && steps.checkdiff.conclusion == 'failure' }} # Only create the review if `checkdiff` found some errors.
uses: actions/github-script@v7
with:
script: |
github.rest.pulls.createReview({
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `**Checkdiff:** <pre><code>${{ steps.checkdiff.outputs.response }}</code></pre>`,
event: "REQUEST_CHANGES",
})

...and we'd make checkdiff return a non-zero error status if any checks fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think checkdiff should ever fail that way: false positives are expected sometimes, and CI as a whole shouldn't be marked as ❌ just because of that.

@Rangi42
Copy link
Contributor Author

Rangi42 commented Oct 23, 2024

Closing this for now, maybe we'll come back to it in the Rust port.

@Rangi42 Rangi42 closed this Oct 23, 2024
@Rangi42 Rangi42 deleted the checkdiff-comment branch October 23, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta This isn't related to the tools directly: repo organization, maintainership...
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants