Skip to content

Commit 193836c

Browse files
committed
fix: ci
1 parent 885878f commit 193836c

File tree

1 file changed

+21
-33
lines changed

1 file changed

+21
-33
lines changed
Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,39 @@
11
name: Update Snapshots
22

33
on:
4-
# Run any time any issue/PR has a new comment
54
issue_comment:
65
types: [created]
76

87
jobs:
98
slash_command:
10-
name: slash command
11-
# This job will only run if the comment was on a pull requests and matches the slash command
12-
if: ${{ github.event.issue.pull_request && github.event.comment.body == '/update-snapshots'}}
13-
# Common with standard build
14-
timeout-minutes: 60
9+
name: Slash Command
10+
if: ${{ github.event.issue.pull_request && contains(github.event.comment.body, '/update-snapshots')}}
1511
runs-on: ubuntu-latest
1612
steps:
17-
# Checkout with personal TOKEN
18-
# and hop on the PR branch
19-
- uses: actions/checkout@v3
13+
- name: Checkout code
14+
uses: actions/checkout@v3
2015
with:
21-
fetch-depth: 0
22-
token: ${{ secrets.GH_ACTION_TOKEN }}
23-
- name: Get Branch
24-
id: getbranch
25-
run: |
26-
branch=$(\
27-
curl \
28-
-H 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
29-
https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }} \
30-
| jq -r '.head.ref')
31-
echo "::set-output name=branch::$branch"
32-
- name: Fetch Branch
33-
run: git fetch
34-
- name: Checkout Branch
35-
run: git checkout ${{ steps.getbranch.outputs.branch }}
36-
# Continue with standard build
16+
ref: ${{ github.event.pull_request.head.sha }}
17+
token: ${{ secrets.GITHUB_TOKEN }}
18+
3719
- name: Use Node.js
3820
uses: actions/setup-node@v3
3921
with:
40-
node-version: 20
22+
node-version: '14'
23+
4124
- name: Install dependencies
42-
run: pnpm install
25+
run: npm install
26+
4327
- name: Install Playwright
44-
run: npx playwright install --with-deps
45-
# Update the snapshots
28+
run: npx playwright install
29+
4630
- name: Update snapshots
4731
run: npx playwright test --update-snapshots --reporter=list
48-
# Commit the changes
49-
- uses: stefanzweifel/git-auto-commit-action@v4
50-
with:
51-
commit_message: Update Snapshots
32+
33+
- name: Commit and push updated snapshots
34+
run: |
35+
git config --global user.name 'Your Name'
36+
git config --global user.email 'you@example.com'
37+
git add .
38+
git commit -m "Update snapshots"
39+
git push

0 commit comments

Comments
 (0)