Skip to content

Commit

Permalink
patch: Add Cloudflare Pages link as PR comment
Browse files Browse the repository at this point in the history
Signed-off-by: Vipul Gupta (@vipulgupta2048) <[email protected]>
  • Loading branch information
vipulgupta2048 committed Jul 11, 2024
1 parent 6314b50 commit 294697c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/flowzone.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 4 additions & 8 deletions flowzone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3289,28 +3289,24 @@ jobs:
apiToken: ${{ secrets.CF_API_TOKEN }}
accountId: ${{ secrets.CF_ACCOUNT_ID }}
wranglerVersion: "3.5.1" # latest - https://www.npmjs.com/package/wrangler
command: --version
postCommands: npx wrangler pages deploy --branch ${{ env.CF_BRANCH }} --project-name=${{ inputs.cloudflare_website }} build/ | tee -a $GITHUB_STEP_SUMMARY
command: pages deploy --branch ${{ env.CF_BRANCH }} --project-name=${{ inputs.cloudflare_website }} build/

- name: Find Cloudflare Pages link comment
uses: peter-evans/find-comment@v3
id: find_cf_comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'flowzone-app[bot]'
body-includes: Website deployed to CF Pages, 👀 preview link
token: ${{ steps.gh_app_token.outputs.token || secrets.FLOWZONE_TOKEN }}

- name: Create or update Cloudflare Pages link comment
- name: Create or update Cloudflare Pages link comment if deployment link present
uses: peter-evans/create-or-update-comment@v4
# if: steps.deploy_cf_pages.outputs.deployment-url != ''
if: steps.deploy_cf_pages.outputs.deployment-url != ''
with:
comment-id: ${{ steps.find_cf_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
edit-mode: replace
body: |
Website deployed to CF Pages, 👀 preview link ${{ steps.deploy_cf_pages.outputs.deployment-url }}
edit-mode: replace
token: ${{ steps.gh_app_token.outputs.token || secrets.FLOWZONE_TOKEN }}
###################################################
# GitHub
Expand Down

0 comments on commit 294697c

Please sign in to comment.