From 02edfc839962b89c845b79aa5bbea6e0cb114f3d Mon Sep 17 00:00:00 2001
From: Fabien Lavocat <4154532+FabienLavocat@users.noreply.github.com>
Date: Thu, 30 Jul 2026 09:18:26 -0700
Subject: [PATCH 1/4] Add script to comment on PR
Signed-off-by: Fabien Lavocat <4154532+FabienLavocat@users.noreply.github.com>
---
.github/workflows/_deploy.yml | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml
index 02c123db691c..6c73a63d7162 100644
--- a/.github/workflows/_deploy.yml
+++ b/.github/workflows/_deploy.yml
@@ -38,6 +38,13 @@ jobs:
permissions:
id-token: write
steps:
+ - name: Create app token
+ uses: actions/create-github-app-token@v3
+ id: app-token
+ with:
+ client-id: ${{ vars.THEOPLAYER_BOT_APP_ID }}
+ private-key: ${{ secrets.THEOPLAYER_BOT_PRIVATE_KEY }}
+
- name: Download build artifact 🗃️
uses: actions/download-artifact@v8
with:
@@ -69,3 +76,21 @@ jobs:
env:
CF_DISTRIBUTION_ID: ${{ vars.CF_DISTRIBUTION_ID }}
PATH_TO_INVALIDATE: ${{ inputs.cf_invalidate_path }}
+
+ - name: Add comment to Pull Request with link to preview 🕸️
+ uses: actions/github-script@v9
+ if: ${{ inputs.environment_name == 'preview' }}
+ with:
+ github-token: ${{ steps.app-token.outputs.token }}
+ script: |
+ const body = `:---:
+ | :rocket: View preview at
${{ inputs.environment_url }}
+ |
Deployed on ${new Date(Date.now()).toGMTString()}
+ `
+
+ await github.rest.issues.createComment({
+ issue_number: context.issue.number,
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ body: body
+ })
From 143d2c4246f3d053c5ca1d5a713f802b8a86b89c Mon Sep 17 00:00:00 2001
From: Fabien Lavocat <4154532+FabienLavocat@users.noreply.github.com>
Date: Thu, 30 Jul 2026 10:50:29 -0700
Subject: [PATCH 2/4] Add missing secrets inherit
---
.github/workflows/pull-request.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml
index 4c5d47dbbd2e..0f441de01144 100644
--- a/.github/workflows/pull-request.yml
+++ b/.github/workflows/pull-request.yml
@@ -36,6 +36,7 @@ jobs:
# Do not run on PRs from Dependabot, since they should not need it.
if: ${{ github.event.action != 'closed' && github.triggering_actor != 'dependabot[bot]' }}
uses: ./.github/workflows/_deploy.yml
+ secrets: inherit
with:
environment_name: preview
environment_url: '${{ vars.PREVIEW_CLOUDFRONT_URL }}/pr-${{ github.event.number }}/'
From 701e363ffa51c09a6d2ef3f5f71f62b02ba5f91f Mon Sep 17 00:00:00 2001
From: Fabien Lavocat <4154532+FabienLavocat@users.noreply.github.com>
Date: Thu, 30 Jul 2026 11:03:15 -0700
Subject: [PATCH 3/4] Update comment markdown
---
.github/workflows/_deploy.yml | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml
index 6c73a63d7162..cea562f40626 100644
--- a/.github/workflows/_deploy.yml
+++ b/.github/workflows/_deploy.yml
@@ -83,10 +83,11 @@ jobs:
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
- const body = `:---:
- | :rocket: View preview at
${{ inputs.environment_url }}
- | Deployed on ${new Date(Date.now()).toGMTString()}
- `
+ const body = `| |
+ |---|
+ | :rocket: View preview at: ${{ inputs.environment_url }} |
+ | Deployed on ${new Date(Date.now()).toGMTString()}
|
+ `;
await github.rest.issues.createComment({
issue_number: context.issue.number,
From fb41783380dec4eb60c7f342049dea59d2fa876a Mon Sep 17 00:00:00 2001
From: Fabien Lavocat <4154532+FabienLavocat@users.noreply.github.com>
Date: Thu, 30 Jul 2026 11:15:47 -0700
Subject: [PATCH 4/4] Update comment text
---
.github/workflows/_deploy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/_deploy.yml b/.github/workflows/_deploy.yml
index cea562f40626..51f620a02063 100644
--- a/.github/workflows/_deploy.yml
+++ b/.github/workflows/_deploy.yml
@@ -83,7 +83,7 @@ jobs:
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
- const body = `| |
+ const body = `| Preview |
|---|
| :rocket: View preview at: ${{ inputs.environment_url }} |
| Deployed on ${new Date(Date.now()).toGMTString()}
|