From 943556a3a9fd682bda6de385adbce82582019648 Mon Sep 17 00:00:00 2001 From: Adam R <13562139+catenocrypt@users.noreply.github.com> Date: Tue, 23 Feb 2021 10:30:14 +0100 Subject: [PATCH] Merge fix and history build into one. (#5667) Co-authored-by: Catenocrypt --- .github/workflows/fix.yml | 16 ++++++++++++---- .github/workflows/history.yml | 33 --------------------------------- 2 files changed, 12 insertions(+), 37 deletions(-) delete mode 100644 .github/workflows/history.yml diff --git a/.github/workflows/fix.yml b/.github/workflows/fix.yml index 8a172e3c4..0e8ba3ce7 100644 --- a/.github/workflows/fix.yml +++ b/.github/workflows/fix.yml @@ -1,7 +1,10 @@ -name: Fixes +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 on: push: - # This runs on fork branches too branches: [ '*' ] workflow_dispatch: jobs: @@ -14,6 +17,8 @@ jobs: with: token: ${{ secrets.COMMIT_TOKEN }} ref: ${{ github.ref }} + # this is needed for history, needs to access prev commits + fetch-depth: 0 - name: Checkout (fork repo, default token) if: github.repository_owner != 'trustwallet' uses: actions/checkout@v2 @@ -31,7 +36,10 @@ jobs: - name: Run fix-sanity script (fork repo, sanity only) if: github.repository_owner != 'trustwallet' run: npm run fix-sanity - - name: Show fix result (diff); run 'npm run fix' locally + - name: Run history + if: github.repository_owner == 'trustwallet' && github.branch == 'master' + run: npm run history + - name: Show result (diff) (run 'npm run fix' locally) run: | git status git diff @@ -45,4 +53,4 @@ jobs: with: commit_user_name: trust-wallet-merge-bot commit_user_email: mergebot@trustwallet.com - commit_message: Fixes (sanity and consistency, auto) + commit_message: Fixes (sanity and consistency, auto), history diff --git a/.github/workflows/history.yml b/.github/workflows/history.yml deleted file mode 100644 index 65979902a..000000000 --- a/.github/workflows/history.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: History update -on: - push: - branches: [ master ] - workflow_dispatch: -jobs: - check: - runs-on: ubuntu-latest - steps: - - name: Checkout (with secret token) - uses: actions/checkout@v2 - with: - token: ${{ secrets.COMMIT_TOKEN }} - ref: ${{ github.ref }} - fetch-depth: 0 - - uses: actions/setup-node@v1 - with: - node-version: 12 - - name: Install Dependencies - run: npm ci - - name: Run history - run: npm run history - - name: Show history update result (diff) - run: | - git status - git diff - - name: Commit changes - if: success() - uses: stefanzweifel/git-auto-commit-action@v4.1.2 - with: - commit_user_name: trust-wallet-merge-bot - commit_user_email: mergebot@trustwallet.com - commit_message: History update