Update monday-ui-style #35820
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: Update monday-ui-style | |
on: | |
schedule: | |
- cron: "*/10 * * * *" | |
jobs: | |
get-version: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch release version | |
run: | | |
echo "installed version" | |
node -p "require('./package.json').dependencies['monday-ui-style']" | |
echo "latest version" | |
npm show monday-ui-style version | |
echo "CURRENT_VERSION=$(node -p "require('./package.json').dependencies['monday-ui-style']")" >> $GITHUB_ENV | |
echo "LATEST_VERSION=$(npm show monday-ui-style version)" >> $GITHUB_ENV | |
- name: Read release version | |
id: read-release-version | |
run: | | |
echo "var current" | |
echo "${{ env.CURRENT_VERSION }}" | |
echo "var latest" | |
echo "${{ env.LATEST_VERSION }}" | |
echo ::set-output name=branch_exists::$([ -z "`git ls-remote --heads origin update-version/style-version-${{env.LATEST_VERSION}}`" ] && echo "false" || echo "true") | |
- name: Same version | |
if: ${{ env.CURRENT_VERSION == env.LATEST_VERSION }} | |
run: | | |
echo "same version" | |
- name: Not same version - install & check changes | |
id: git-check | |
if: ${{ env.CURRENT_VERSION != env.LATEST_VERSION && steps.read-release-version.outputs.branch_exists == 'false' }} | |
run: | | |
echo "Not same version" | |
npm install monday-ui-style@${{env.LATEST_VERSION}} --save-exact | |
echo ::set-output name=modified::$([ -z "`git status --porcelain`" ] && echo "false" || echo "true") | |
- name: Build react icons | |
if: steps.git-check.outputs.modified == 'true' | |
id: build-react-icons | |
run: | | |
npm install | |
npm run build:react-icons | |
echo ::set-output name=success::$(echo "true") | |
- name: Create a pr | |
if: steps.build-react-icons.outputs.success == 'true' | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
commit-message: "Update icons - monday-ui-style ${{ env.LATEST_VERSION }}" | |
committer: Monday Style <[email protected]> | |
author: Monday Style <[email protected]> | |
branch: update-version/style-version-${{env.LATEST_VERSION}} | |
title: "Update icons - monday-ui-style ${{ env.LATEST_VERSION }}" | |
body: | | |
New icons version | |
labels: | | |
PR: Icon 💎 | |
team-reviewers: vibe | |
draft: false |