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

feat: Add comment on PR #20

Merged
merged 3 commits into from
Jul 13, 2021
Merged

feat: Add comment on PR #20

merged 3 commits into from
Jul 13, 2021

Conversation

damcou
Copy link
Collaborator

@damcou damcou commented Jul 2, 2021

Add comment logic in the action to add a comment on the PR

@netlify
Copy link

netlify bot commented Jul 2, 2021

✔️ Deploy Preview for algolia-ga-actions-netlify ready!

🔨 Explore the source changes: 5a19575

🔍 Inspect the deploy log: https://app.netlify.com/sites/algolia-ga-actions-netlify/deploys/60ed58329830d400089279f1

😎 Browse the preview: https://deploy-preview-20--algolia-ga-actions-netlify.netlify.app

@damcou damcou requested a review from bodinsamuel July 12, 2021 14:56
.github/workflows/netlify.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@@ -54,6 +56,34 @@ function getRecordExtractorSource(): string {
}`;
}

function addComment(crawlerId: string): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

This PR should have a comment no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, the GA tests are running the version 0.6 which doesn't have the comment feature yet. I'm not sure how to test it efficently

Copy link
Contributor

Choose a reason for hiding this comment

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

let's try with the next PR

src/index.ts Outdated Show resolved Hide resolved
src/index.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@bodinsamuel bodinsamuel left a comment

Choose a reason for hiding this comment

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

👌🏻

const prNumber = context.payload.pull_request.number;

const octokit = github.getOctokit(GITHUB_TOKEN);
octokit.rest.issues.createComment({
Copy link
Contributor

Choose a reason for hiding this comment

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

Now that I think about it, would be create to not recreate a comment but find the previous one
can be done in an other PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I was just having a look at that GA : https://github.com/marketplace/actions/find-comment

@damcou damcou marked this pull request as ready for review July 13, 2021 14:08
@damcou damcou merged commit 6ed9d2c into main Jul 13, 2021
@damcou damcou deleted the feat/add-pr-comment branch July 13, 2021 14:11
algolia-crawler-bot pushed a commit that referenced this pull request Jul 13, 2021
# [0.7.0](v0.6.0...v0.7.0) (2021-07-13)

### Features

* Add comment on PR ([#20](#20)) ([6ed9d2c](6ed9d2c))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants