Skip to content

Commit de50759

Browse files
committed
fix after-ci to not require checkout
1 parent 01987c3 commit de50759

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

.github/get_preview_url.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

.github/workflows/after-ci.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ jobs:
6262
workflow_conclusion: completed
6363
if_no_artifact_found: warn
6464

65-
- uses: actions/setup-node@v4
66-
- run: npm install
67-
working-directory: docs-site
68-
6965
- run: 'echo head_sha $VAR'
7066
env:
7167
VAR: ${{ github.event.workflow_run.head_sha }}
@@ -86,8 +82,22 @@ jobs:
8682
--var GIT_COMMIT_SHA:${{ github.event.workflow_run.head_sha }}
8783
--var GIT_BRANCH:${{ github.event.workflow_run.head_branch }}
8884
85+
# work around for https://github.com/cloudflare/wrangler-action/issues/349
8986
- name: get preview URL
9087
id: get_preview_url
91-
run: python .github/get_preview_url.py >> $GITHUB_OUTPUT
88+
shell: python
89+
run: |
90+
import os
91+
import re
92+
deploy_output = os.environ['DEPLOY_OUTPUT']
93+
m = re.search(r'https://(\S+)\.workers\.dev', deploy_output)
94+
assert m, f'Could not find worker URL in {deploy_output!r}'
95+
worker_name = m.group(1)
96+
m = re.search(r'Current Version ID: ([^-]+)', deploy_output)
97+
assert m, f'Could not find version ID in {deploy_output!r}'
98+
version_id = m.group(1)
99+
preview_url = f'https://{version_id}-{worker_name}.workers.dev'
100+
with open(os.environ['GITHUB_OUTPUT'], 'w') as f:
101+
f.write(f'preview_url={preview_url}\n')
92102
env:
93103
DEPLOY_OUTPUT: ${{ steps.deploy.outputs.command-output }}

0 commit comments

Comments
 (0)