Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/pr-playground-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ permissions:
jobs:
preview:
runs-on: ubuntu-latest
# Fork PRs get a read-only token, so the branch push below would fail.
# Skip on forks rather than letting the push step hard-fail.
if: github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -29,8 +32,14 @@ jobs:
run: npm i

- name: Update version placeholder
env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
sed -i "s/__VERSION__/Pull Request #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}/g" popup.php
# PR_NUMBER is numeric, so it is safe to substitute. Never
# interpolate the PR title here — it is attacker controlled and
# would run as shell on the runner.
sed -i "s/__VERSION__/0.0.0-pr${PR_NUMBER}/g" popup.php
grep -n "Version:" popup.php

- name: Build
run: npm run build
Expand Down
Loading