-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (39 loc) · 1.27 KB
/
update-msw.yml
File metadata and controls
44 lines (39 loc) · 1.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Update MSW Service Worker
on:
workflow_dispatch:
push:
branches-ignore:
- main
paths:
- pnpm-lock.yaml
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
UpdateMSW:
if: github.event_name == 'workflow_dispatch' || startsWith(github.ref_name, 'renovate/')
runs-on: ubuntu-24.04
environment: bot
timeout-minutes: 10
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
persist-credentials: false
- name: Setup Project
uses: ./.github/actions/setup
- name: Update and commit mockServiceWorker.js
env:
PUSH_TOKEN: ${{ secrets.PUSH_TOKEN }}
run: |
pnpm msw init public --save
git add public/mockServiceWorker.js
if ! git diff --staged --quiet; then
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${PUSH_TOKEN}@github.com/${{ github.repository }}.git"
git commit -m "chore: update mockServiceWorker.js"
git push
fi