2021-02-23 09:30:14 +00:00
|
|
|
name: Fixes and History
|
|
|
|
# Runs on:
|
|
|
|
# - on master branch of trustwallet repo: fix, history update, checkin
|
|
|
|
# - on other branch of trustwallet repo: fix, checkin
|
|
|
|
# - on fork repos: fix-sanity only
|
2020-04-17 02:27:40 +00:00
|
|
|
on:
|
|
|
|
push:
|
2020-08-07 09:29:42 +00:00
|
|
|
branches: [ '*' ]
|
2020-08-08 21:01:45 +00:00
|
|
|
workflow_dispatch:
|
2020-04-17 02:27:40 +00:00
|
|
|
jobs:
|
2020-08-10 08:56:41 +00:00
|
|
|
fix-all:
|
2020-04-17 02:27:40 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2020-08-07 10:47:01 +00:00
|
|
|
- name: Checkout (trustwallet repo, secret token)
|
|
|
|
if: github.repository_owner == 'trustwallet'
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
2020-11-01 06:01:39 +00:00
|
|
|
token: ${{ secrets.COMMIT_TOKEN }}
|
2020-08-07 10:47:01 +00:00
|
|
|
ref: ${{ github.ref }}
|
2021-02-23 09:30:14 +00:00
|
|
|
# this is needed for history, needs to access prev commits
|
|
|
|
fetch-depth: 0
|
2020-08-07 10:47:01 +00:00
|
|
|
- name: Checkout (fork repo, default token)
|
|
|
|
if: github.repository_owner != 'trustwallet'
|
|
|
|
uses: actions/checkout@v2
|
2020-07-30 04:59:24 +00:00
|
|
|
with:
|
2020-08-07 09:29:42 +00:00
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2020-08-07 08:56:27 +00:00
|
|
|
ref: ${{ github.ref }}
|
2020-07-30 04:59:24 +00:00
|
|
|
- uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
- name: Install Dependencies
|
|
|
|
run: npm ci
|
2020-08-10 08:56:41 +00:00
|
|
|
- name: Run fix script (trustwallet repo, sanity and consistency)
|
|
|
|
if: github.repository_owner == 'trustwallet'
|
2020-07-30 04:59:24 +00:00
|
|
|
run: npm run fix
|
2020-08-12 13:31:48 +00:00
|
|
|
- name: Run fix-sanity script (fork repo, sanity only)
|
2020-08-10 08:56:41 +00:00
|
|
|
if: github.repository_owner != 'trustwallet'
|
|
|
|
run: npm run fix-sanity
|
2021-02-23 10:26:05 +00:00
|
|
|
- name: Debug
|
|
|
|
run: echo GITHUB_REF: $GITHUB_REF GITHUB_BASE_REF: $GITHUB_BASE_REF
|
2021-02-23 09:30:14 +00:00
|
|
|
- name: Run history
|
2021-02-23 10:03:24 +00:00
|
|
|
if: github.repository_owner == 'trustwallet' && (github.base_ref == 'master' || github.ref == 'refs/heads/master')
|
2021-02-23 09:30:14 +00:00
|
|
|
run: npm run history
|
|
|
|
- name: Show result (diff) (run 'npm run fix' locally)
|
2020-08-07 08:56:27 +00:00
|
|
|
run: |
|
|
|
|
git status
|
|
|
|
git diff
|
2020-08-06 19:17:38 +00:00
|
|
|
- name: Run check
|
|
|
|
run: npm run check
|
2020-07-30 04:59:24 +00:00
|
|
|
- name: Run test
|
|
|
|
run: npm t
|
2020-08-07 09:29:42 +00:00
|
|
|
- name: Commit changes
|
2020-08-12 13:31:48 +00:00
|
|
|
if: success()
|
2020-07-30 04:59:24 +00:00
|
|
|
uses: stefanzweifel/git-auto-commit-action@v4.1.2
|
|
|
|
with:
|
|
|
|
commit_user_name: trust-wallet-merge-bot
|
|
|
|
commit_user_email: mergebot@trustwallet.com
|
2021-02-23 09:30:14 +00:00
|
|
|
commit_message: Fixes (sanity and consistency, auto), history
|