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

Fix: PR Preview URL to Use Base Repository #4855

Merged
merged 2 commits into from
Aug 8, 2024

Conversation

AdarshRawat1
Copy link
Member

@AdarshRawat1 AdarshRawat1 commented Aug 6, 2024

Enhancement for more robust PR previews.

I noticed that when a workflow is triggered by a user commits from a fork, the preview link points to their repository due to the DOMAIN setting using ${{ github.actor }}. This was causing the preview to point to the forked repository rather than the base repository. I have updated the DOMAIN to use ${{ github.event.pull_request.base.repo.owner.login }}.github.io, which ensures that the preview link always points to the base repository, regardless of who triggers the workflow.

@fruffy fruffy added the documentation Topics related to compiler documentation. label Aug 6, 2024
@fruffy fruffy added this pull request to the merge queue Aug 6, 2024
Copy link
Contributor

github-actions bot commented Aug 6, 2024

githubloading A preview of this PR is available at: Preview Link
📂 View the source code here: View Source Code
🔧 Commit used for deployment: 59b93ad0177c2888285bd8237baf08c56e67c9a3

Note: Changes may take a few seconds to appear on GitHub Pages. Please refresh the page if you do not see the updates immediately.

@fruffy fruffy removed this pull request from the merge queue due to a manual request Aug 6, 2024
@AdarshRawat1 AdarshRawat1 requested a review from fruffy August 8, 2024 03:32
@fruffy
Copy link
Collaborator

fruffy commented Aug 8, 2024

@AdarshRawat1 The current preview is broken because it uses the PR users URL, the p4lang.

@AdarshRawat1
Copy link
Member Author

@AdarshRawat1 The current preview is broken because it uses the PR users URL, the p4lang.

Yes @fruffy you are right, this PR fixes the same.

@fruffy
Copy link
Collaborator

fruffy commented Aug 8, 2024

@AdarshRawat1 The current preview is broken because it uses the PR users URL, the p4lang.

Yes @fruffy you are right, this PR fixes the same.

So the Github actions comment above is stale and does not use the changes?

@AdarshRawat1
Copy link
Member Author

@AdarshRawat1 The current preview is broken because it uses the PR users URL, the p4lang.

Yes @fruffy you are right, this PR fixes the same.

So the Github actions comment above is stale and does not use the changes?

Thanks @fruffy for catching that!
Apologies for the oversight and any inconvenience caused.

@AdarshRawat1 AdarshRawat1 marked this pull request as draft August 8, 2024 07:07
@AdarshRawat1
Copy link
Member Author

AdarshRawat1 commented Aug 8, 2024

After updating the Domain to p4lang the workflow gets updated , but the workflow is using reference of the user who initiated the build.

This mean that it is running stale workflow...

@AdarshRawat1 AdarshRawat1 marked this pull request as ready for review August 8, 2024 07:17
@fruffy
Copy link
Collaborator

fruffy commented Aug 8, 2024

Let me try. I can rebase this branch and then check whether the URL changes. If that is the case we can merge and try with the next PR. It's a little strange though, it should use the active Github action...

AdarshRawat1 and others added 2 commits August 8, 2024 09:19
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
Signed-off-by: Adarsh <Adarshbunny293@gmail.com>
@fruffy fruffy enabled auto-merge August 8, 2024 07:53
@fruffy
Copy link
Collaborator

fruffy commented Aug 8, 2024

Okay, the preview URL does indeed change with the user that pushed last. Let's see whether merging this PR changes that, could you create another test PR after?

@fruffy fruffy added this pull request to the merge queue Aug 8, 2024
Merged via the queue into p4lang:main with commit 63c4071 Aug 8, 2024
17 of 18 checks passed
@AdarshRawat1
Copy link
Member Author

Okay, the preview URL does indeed change with the user that pushed last. Let's see whether merging this PR changes that, could you create another test PR after?

It is working now, Thanks for the merge !!

The Issue is, when a PR updates the workflows, GitHub Action shows the updated Workflow in workflow run file but runs the old workflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Topics related to compiler documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants