From 2a8fcc707cf9411a0473f3c7dd569dd602dc67e0 Mon Sep 17 00:00:00 2001 From: Adam R <13562139+catenocrypt@users.noreply.github.com> Date: Tue, 23 Feb 2021 11:00:47 +0100 Subject: [PATCH] [Internal] Filter changed files to blockchains and dapps folders (#5668) * Merge fix and history build into one. * Filter chganged files to blockchains and dapps foldersx). * Debug github.ref * Fix echo * Debug * Debug * Remove * Debug * Debug * Setup history conditions * Cleanup Co-authored-by: Catenocrypt --- .github/workflows/fix.yml | 4 +++- script/generic/history.ts | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/fix.yml b/.github/workflows/fix.yml index 0e8ba3ce7..63e8d68e8 100644 --- a/.github/workflows/fix.yml +++ b/.github/workflows/fix.yml @@ -36,8 +36,10 @@ jobs: - name: Run fix-sanity script (fork repo, sanity only) if: github.repository_owner != 'trustwallet' run: npm run fix-sanity + - name: Debug # TODO remove + run: echo $GITHUB_REF $GITHUB_BASE_REF {{github.branch}} {{github.ref}} - name: Run history - if: github.repository_owner == 'trustwallet' && github.branch == 'master' + if: github.repository_owner == 'trustwallet' && (github.base_ref == 'master' || github.ref == 'master') run: npm run history - name: Show result (diff) (run 'npm run fix' locally) run: | diff --git a/script/generic/history.ts b/script/generic/history.ts index e74562ba2..5a0b307e1 100644 --- a/script/generic/history.ts +++ b/script/generic/history.ts @@ -14,7 +14,8 @@ class VersionInfo { const FilenameLatest = "history/LATEST.json"; const FilenameChangeTemplate = "history/versions/"; -const IgnoreHistoryPrefix = "history/"; +const IncludeHistoryPrefix1 = "blockchains/"; +const IncludeHistoryPrefix2 = "dapps/"; const TooManyChangesLimit = 40; //const util = require('util'); @@ -82,8 +83,7 @@ async function getChangedFiles(commitStart: string, commitEnd: string): Promise< function filterChangedFiles(files: string[]): string[] { return files.filter(l => { - if (l.startsWith(IgnoreHistoryPrefix)) return false; - return true; + return (l.startsWith(IncludeHistoryPrefix1) || l.startsWith(IncludeHistoryPrefix2)); }); }