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

Option to prevent PRs from indexing #843

Open
IstoraMandiri opened this issue Oct 20, 2022 · 5 comments
Open

Option to prevent PRs from indexing #843

IstoraMandiri opened this issue Oct 20, 2022 · 5 comments

Comments

@IstoraMandiri
Copy link

IstoraMandiri commented Oct 20, 2022

It seems that PR previews will trigger a full index if they have the same branch name as those defined in plugins.inputs.

Is there a way to skip the index when a repository, not just the branch, is specified?

@sbellone
Copy link
Collaborator

I don't understand, do you mean that the plugin triggers on a repository on which it's not installed?

@IstoraMandiri
Copy link
Author

IstoraMandiri commented Oct 20, 2022

See this PR. It is ethereumclassic/ethereumclassic.github.io#926

In the build, it is triggering an index, even though it is just a preview PR onto master, but the source repo is an outside contributor's "master" branch. I want to skip indexes for this scenario and only index when the main repo's master branch updates.

https://app.netlify.com/sites/ethereumclassic/deploys/6348c9bd9df5ae0008f78441#L212

@sbellone
Copy link
Collaborator

I see, thanks for the explanation. Indeed we'd have to see if there is a way to differentiate those preview PRs from the actual repository on Netlify side. Thanks for reporting!

@IstoraMandiri
Copy link
Author

You are welcome.

Hopefully a fix is able to be identified as there are probably a few repos out there that generate previews from PRs, and using this plugin in this way could lead to search indexes being vandalized.

@IstoraMandiri
Copy link
Author

IstoraMandiri commented Nov 4, 2022

@sbellone This can now be worked around using https://www.netlify.com/blog/scopes-and-contextual-values-for-environment-variables-ga/

EDIT: My mistake, this is only true for the gatsby-plugin-algolia indexing plugin, not the netlify plugin itself, sorry.

Still need this feature.

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

No branches or pull requests

2 participants