Merge bd43cce8e6b6130a8f7cb310fbad91ad36038152 into main #1765
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: [ main, release/*, chore/carbon-upgrade-* ] | |
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@v3 | |
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 |