Skip to content
Merged
Changes from 1 commit
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
10 changes: 10 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -34,6 +36,14 @@ jobs:
- name: Build worker bundle
run: npm run build:worker

- name: Commit worker bundle
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add dist/worker.bundle.js
git commit -m "Build: Update worker bundle [skip ci]" || exit 0
git push

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Skip committing worker bundle during pull_request runs

The new "Commit worker bundle" step unconditionally commits and pushes the generated dist/worker.bundle.js. However this workflow is triggered for both push and pull_request. On PR runs the checkout is a detached ref with a read‑only GITHUB_TOKEN, so git push will fail (“not on a branch” or permission denied) and the whole build will error even when the PR otherwise builds fine. This step needs an if guard so it only runs on writable refs (e.g. github.event_name == 'push') or it should be moved to a separate workflow.

Useful? React with 👍 / 👎.


- name: Create build metadata
run: |
VERSION=$(node -p "require('./package.json').version")
Expand Down
Loading