-
Notifications
You must be signed in to change notification settings - Fork 160
49 lines (45 loc) · 1.52 KB
/
snapshot-update.yml
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
45
46
47
48
49
name: snapshot-update
on:
push:
branches: [ v1 ]
concurrency:
group: snapshot-update-${{ github.ref }}
cancel-in-progress: true
jobs:
react:
if: github.repository == 'carbon-design-system/carbon-for-ibm-dotcom'
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: ['14.x']
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.MERGE_ACTION}}
- name: Use Node.js 14.x
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'yarn'
- name: Get branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: get_branch
- name: Install dependencies
run: yarn install --immutable --immutable-cache
- name: Build project
run: yarn lerna run --stream --ignore @carbon/ibmdotcom-web-components --ignore @carbon/ibmdotcom-services-store build
- name: Run snapshot update
working-directory: packages/react
run: yarn test:unit:updateSnapshot
- name: Push changes
run: |
if [ -z "$(git status --porcelain)" ]; then
echo "Mirror is clean, exiting..."
else
git config --global user.email ${{ secrets.BOT_EMAIL }}
git config --global user.name ${{ secrets.BOT_NAME }}
git add -A
git commit -m "chore(snapshot): update react snapshot files"
git push origin ${{ steps.get_branch.outputs.branch }}
fi