update-types #5349
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-types | |
on: | |
schedule: | |
- cron: '0 5-15 * * 1-5' | |
workflow_dispatch: | |
jobs: | |
update-types: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: install requirements | |
run: yarn install | |
- name: build | |
run: yarn build | |
- name: update types | |
run: | | |
yarn export-types:all | |
- name: diff check | |
id: diff-check | |
run: | | |
echo "types-diff=$(git diff HEAD | wc -l)" >> $GITHUB_ENV | |
- name: bump version # if types changed | |
if: ${{ env.types-diff > 0 }} | |
run: yarn bump-version | |
- name: commit and pr # if types changed | |
id: pr | |
if: ${{ env.types-diff > 0 }} | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
branch: types-autoupdate | |
title: 'Types autoupdate' | |
body: 'Types checked and update is required' | |
reviewers: | | |
stefashkaa | |
Nikita-Polyakov | |
alexnatalia | |
RustemYuzlibaev | |
Tieumsan | |
- name: send message to telegram # if types changed | |
if: ${{ env.types-diff > 0 }} | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
New pull request created to update types in sora2-substrate-js-library | |
Repository: ${{ github.repository }} | |
See changes: ${{ steps.pr.outputs.pull-request-url }} |