[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 <catenocrypt@users.noreply.github.com>
This commit is contained in:
Adam R 2021-02-23 11:00:47 +01:00 committed by GitHub
parent 943556a3a9
commit 2a8fcc707c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -36,8 +36,10 @@ jobs:
- name: Run fix-sanity script (fork repo, sanity only) - name: Run fix-sanity script (fork repo, sanity only)
if: github.repository_owner != 'trustwallet' if: github.repository_owner != 'trustwallet'
run: npm run fix-sanity run: npm run fix-sanity
- name: Debug # TODO remove
run: echo $GITHUB_REF $GITHUB_BASE_REF {{github.branch}} {{github.ref}}
- name: Run history - 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 run: npm run history
- name: Show result (diff) (run 'npm run fix' locally) - name: Show result (diff) (run 'npm run fix' locally)
run: | run: |

View File

@ -14,7 +14,8 @@ class VersionInfo {
const FilenameLatest = "history/LATEST.json"; const FilenameLatest = "history/LATEST.json";
const FilenameChangeTemplate = "history/versions/"; const FilenameChangeTemplate = "history/versions/";
const IgnoreHistoryPrefix = "history/"; const IncludeHistoryPrefix1 = "blockchains/";
const IncludeHistoryPrefix2 = "dapps/";
const TooManyChangesLimit = 40; const TooManyChangesLimit = 40;
//const util = require('util'); //const util = require('util');
@ -82,8 +83,7 @@ async function getChangedFiles(commitStart: string, commitEnd: string): Promise<
function filterChangedFiles(files: string[]): string[] { function filterChangedFiles(files: string[]): string[] {
return files.filter(l => { return files.filter(l => {
if (l.startsWith(IgnoreHistoryPrefix)) return false; return (l.startsWith(IncludeHistoryPrefix1) || l.startsWith(IncludeHistoryPrefix2));
return true;
}); });
} }