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

Provide a live preview for contributions done from fork repo #686

Closed
tbouffard opened this issue Mar 27, 2024 · 2 comments
Closed

Provide a live preview for contributions done from fork repo #686

tbouffard opened this issue Mar 27, 2024 · 2 comments
Assignees
Labels
CI ⚙️ enhancement New feature or request

Comments

@tbouffard
Copy link
Member

tbouffard commented Mar 27, 2024

ℹ️ Part of a top-level initiative: #670

Currently, the preview is built and only attached as an artifact of the GH Actions run. It is not deployed to surge, so there is no live environment available.
Be also aware of #402.

Current limitations

Resources

Possible solutions

Investigations

See #686 (comment). It also includes next steps.

@tbouffard
Copy link
Member Author

tbouffard commented Apr 19, 2024

Investigations done in week 2024-04-17

Work done with @benjaminParisel

All tests have been done in the https://github.com/process-analytics/github-actions-playground/ repository with a fake site.

Experiment a solution with 2 steps as described in https://securitylab.github.com/research/github-actions-preventing-pwn-requests/

This custom implementation has been tested in a PR created from a fork repo, see process-analytics/github-actions-playground#349. It has also been tested with PR created from the target repository, see process-analytics/github-actions-playground#350.

We have checked that the teardown could be managed in a specific workflow like in process-analytics/github-actions-playground#351

A contribution has been proposed to the official surge-preview action afc163/surge-preview#294 which is based on our experiment.

Next steps

To have a fully working solution

benjaminParisel added a commit to bonitasoft/actions that referenced this issue Apr 24, 2024
* Allow to get the PR number even if this action is called from a
wokflow_run event

Covers
bonitasoft/bonita-documentation-site#686

---------

Co-authored-by: Thomas Bouffard <[email protected]>
benjaminParisel pushed a commit that referenced this issue May 22, 2024
This was not working as the 2 workflow used to deployed called the same
reusable workflow that deployed to the same URL for the 2 environments.
This was because the URL is computed using the job id of the reusable
workflow.
So for "test" deployment, duplicate the logic of the reusable workflow
to have a dedicated URL.

In the "deploy" reusable workflow, use a shorter job id. It is used to
compute the URL of all deployments. A shorter name ensure that we don't
try to generate a too large URL subdomain.

The PR comment relative to the changes will be managed by a dedicated
workflow in the future for a better separation of concerns, to simplify
the maintenance and to make things more explicit. So remove the related
steps (that was still a work in progress) from the reusable workflow in
charge of the deployment.

Covers #686
benjaminParisel added a commit that referenced this issue May 29, 2024
Use a reusable workflow to comment a PR separately then deploy a preview
workflow.
  - This provides a better separation of concerns.
- It also allows direct use of the existing custom action to be executed
in a `pull_request` event context.
- This will require managing an additional workflow in all content
repositories, which will increase maintenance a little, but using a
“reusable workflow” will limit the cost (mainly the cost at installation
time).
- It will be called in workflows triggered by the `pull_request_target`
event (there is no build but only a check of files modified by the PR).

Covers #686
benjaminParisel added a commit to bonitasoft/bonita-doc that referenced this issue Jun 12, 2024
Use the reusable workflow defined in bonita-documentation-site to configure and maintain them more easily.

Covers bonitasoft/bonita-documentation-site#686
Covers bonitasoft/bonita-documentation-site#700
benjaminParisel pushed a commit to bonitasoft/bonita-central-doc that referenced this issue Aug 7, 2024
Use the reusable workflow defined in bonita-documentation-site to
configure and maintain them more easily.

Covers
bonitasoft/bonita-documentation-site#686
Covers
bonitasoft/bonita-documentation-site#700
benjaminParisel pushed a commit to bonitasoft/bonita-test-toolkit-doc that referenced this issue Aug 7, 2024
Use the reusable workflow defined in bonita-documentation-site to
configure and maintain them more easily.

Covers
bonitasoft/bonita-documentation-site#686
Covers
bonitasoft/bonita-documentation-site#700
benjaminParisel pushed a commit to bonitasoft/bonita-continuous-delivery-doc that referenced this issue Aug 7, 2024
Use the reusable workflow defined in bonita-documentation-site to
configure and maintain them more easily.

Covers
bonitasoft/bonita-documentation-site#686
Covers
bonitasoft/bonita-documentation-site#700
@tbouffard
Copy link
Member Author

All tasks are completed, so closing

benjaminParisel pushed a commit to bonitasoft/bonita-cloud-doc that referenced this issue Aug 7, 2024
Use the reusable workflow defined in bonita-documentation-site to
configure and maintain them more easily.

Covers
bonitasoft/bonita-documentation-site#686
Covers
bonitasoft/bonita-documentation-site#700
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI ⚙️ enhancement New feature or request
Development

No branches or pull requests

2 participants