Merge bf6655ea54a1bb6990290ba473959680af4f28d7 into v1 #1914
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |