Skip to content

Commit be4a240

Browse files
authored
Gate docs preview deploy on Cloudflare token presence (#2966)
1 parent c489d7e commit be4a240

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎.github/workflows/main.yml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,12 @@ jobs:
5353
shell: bash
5454

5555
docs-preview:
56-
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]'
56+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
5757
runs-on: ubuntu-latest
5858

59+
env:
60+
HAS_CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN != '' }}
61+
5962
permissions:
6063
contents: read
6164
pull-requests: write
@@ -83,6 +86,7 @@ jobs:
8386

8487
- name: Deploy preview to Cloudflare Pages
8588
id: deploy
89+
if: ${{ env.HAS_CLOUDFLARE_TOKEN == 'true' }}
8690
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
8791
with:
8892
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -93,6 +97,7 @@ jobs:
9397
--branch ${{ github.head_ref }}
9498
9599
- name: Comment preview URL on PR
100+
if: ${{ steps.deploy.outcome == 'success' }}
96101
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
97102
with:
98103
message: |

0 commit comments

Comments
 (0)