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

Improve pull requests: additional instructions #32

Merged
merged 2 commits into from
Sep 18, 2023

Conversation

robmoss
Copy link
Owner

@robmoss robmoss commented Nov 2, 2022

We discovered with #31 that we cannot publish PR previews from forked repositories, and we also need to highlight that new files must be added to the table of contents in src/SUMMARY.md.

We can only publish PR previews from the original repository. The action
fails when the PR originates from a forked repository. For details, see
rossjrw/pr-preview-action#3.
@robmoss robmoss added the enhancement New feature or request label Nov 2, 2022
@github-actions
Copy link

github-actions bot commented Nov 2, 2022

PR Preview Action v1.2.0
🚀 Deployed preview to https://robmoss.github.io/git-is-my-lab-book/pr-preview/pr-32/
on branch gh-pages at 2022-11-02 23:42 UTC

@robmoss
Copy link
Owner Author

robmoss commented Dec 19, 2022

@EamonConway are you happy for me to merge this? By not attempting to publish online previews for PRs outside of this repository, we can avoid CI failures in PRs from forks.

Copy link
Collaborator

@EamonConway EamonConway left a comment

Choose a reason for hiding this comment

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

Only a single comment for me.
If i am wrong please let me know and I am happy for a merge.

- name: Deploy preview
if: github.event.pull_request.head.repo.full_name == github.repository
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would have expected github.event.pull_request.head.repo.full_name and github.repository to be wrapped in ${{}}.
Is this not the case?
I could not think of a way to check this change.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Very good question! I don't think I noted precisely where I found this solution, but this discussion demonstrates that it works. A newer comment suggests an alternative solution. But yeah, the only way I can think to test this is to try to fork this branch and then submit a PR? And I'm not 100% sure that would actually test this feature ...

Copy link
Collaborator

@EamonConway EamonConway Sep 18, 2023

Choose a reason for hiding this comment

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

I agree, that definitely seems to be how it works.

I've tried your suggestion in the pull request #58.
I am happy with the results and am happy for this to be merged to master.

We can also close #58
without merging but still keep a record of the results.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Thanks very much Eamon!

@robmoss robmoss merged commit aa2a96e into master Sep 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants