product-os / flowzone

Reusable, opinionated, zero-conf workflows for GitHub actions
https://flowzone.pages.dev
Apache License 2.0
14 stars 5 forks source link

Create pull request comment when preview available #384

Open vipulgupta2048 opened 1 year ago

vipulgupta2048 commented 1 year ago

To gain parity with GitHub actions on Handbook, we need to add a preview URL message to PR similar to https://github.com/balenaltd/handbook/pull/52#issuecomment-1344153371

From: https://github.com/balenaltd/handbook/blob/main/.github/actions/publish/action.yml

    - name: Create pull request comment
      uses: marocchino/sticky-pull-request-comment@v2
      with:
        header: gh-preview
        GITHUB_TOKEN: ${{ fromJSON(inputs.secrets).FLOWZONE_TOKEN }}
        message: |
          :rocket: Deployed ${{ github.repository }}@${{ github.event.pull_request.head.sha }} to ${{ env.published_url }}

Also, investigate

maggie44 commented 1 year ago

For reference, I am not sure the preview URL in that PR you reference is working. It looks like it is building the docs without the changes in the PR. Maybe something we can explore for this new docs builder rather than digging around in the code which is going to be deprecated.

vipulgupta2048 commented 1 year ago

I referenced only the feature, we do need to build out our own implementation. Cloudflare Pages creates a unique URL every single time so we are covered on that point.

Good thing you told me @maggie0002 This will unblock the PR I have pending for the handbook to convert with Docusarus builder.

anujdeshpande commented 1 year ago

@vipulgupta2048 I think it might be a good idea in general to get some outputs from different flowzone steps in

klutchell commented 1 year ago

An example of this being done for the handbook is here: https://github.com/balenaltd/handbook/tree/50b6c0d9fef1a2a45138fb6869fa8e61103dec5e/.github/actions