Skip to content

Commit

Permalink
Merge pull request #8 from eckelmannf/main
Browse files Browse the repository at this point in the history
Dateien ohne citation.cff und Zitierinformation mit Leerzeichen vor "und" bei vielen Autor*innen.
  • Loading branch information
HannesWuensche authored Dec 14, 2023
2 parents 12d0eaf + 938320b commit cd5477a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 5 additions & 1 deletion createDatasourceJsonAction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3184,7 +3184,7 @@ const js_yaml_1 = __nccwpck_require__(1917);
const DefaultBranch = 'master';
const ContentPathPredicates = [
x => !x.startsWith('.') && !x.startsWith('Archiv'),
x => !_.includes(['LIZENZ', 'LICENSE', 'CITATION.cff'], x)
x => !_.includes(['lizenz', 'license', 'citation.cff'], x.toLowerCase())
];
const TagBlacklist = ['germany', 'deutschland', 'rki'];
const lfsSizeRegEx = /^size\s(?<size>[0-9]*)$/gm;
Expand Down Expand Up @@ -3390,6 +3390,10 @@ function run() {
const doi$ = readDoi(octokit, Object.assign(Object.assign({}, github.context.repo), { homepage: repo.homepage }), tree);
const readmeContent$ = readReadmeMd(octokit, github.context.repo, branch, tree);
const isLfsFile = yield createLfsFileDescriminator(octokit, github.context.repo, tree);
// const debugFiles = tree.map(node => `${node.path} (predicate: ${ContentPathPredicates.every(x => x(node.path!))})`);
// core.info("### TREE ###");
// debugFiles.forEach(x => core.info(x));
// core.info("############")
const relevantTreeItems = tree.filter(node => node.path && ContentPathPredicates.every(x => x(node.path)));
const content = yield treeIt(octokit, relevantTreeItems, isLfsFile, github.context.repo, branch);
const { doi, links } = yield doi$;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class DatasourceCiteComponent implements OnInit, OnChanges {
if (i === 0) {
prev += curr;
} else if (isLast) {
prev += `und ${curr}`
prev += ` und ${curr}`
} else {
prev += `, ${curr}`
}
Expand Down
10 changes: 9 additions & 1 deletion src/github-action/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ import { removeHtmlTags, replaceRelativeRootUrls } from './md-helpers';
import { Contributor, ExternalLink, ZenodoJson, OctokitApi, GithubTreeItem, ContentFile, DatasourceContent, FolderDatasourceContent, FileDatasourceContent, OpenDataDatasource, CitationCff } from './models'
import * as _ from 'lodash';
import { load } from 'js-yaml';
import { debug } from 'console';

const DefaultBranch: string = 'master';
const ContentPathPredicates: ((x: string) => boolean)[] = [
x => !x.startsWith('.') && !x.startsWith('Archiv'),
x => !_.includes(['LIZENZ', 'LICENSE', 'CITATION.cff'], x)
x => !_.includes(['lizenz', 'license', 'citation.cff'], x.toLowerCase())
];
const TagBlacklist: string[] = ['germany', 'deutschland', 'rki'];
const lfsSizeRegEx = /^size\s(?<size>[0-9]*)$/gm;
Expand Down Expand Up @@ -247,7 +248,14 @@ async function run() {
const readmeContent$ = readReadmeMd(octokit, github.context.repo, branch, tree);

const isLfsFile = await createLfsFileDescriminator(octokit, github.context.repo, tree);

// const debugFiles = tree.map(node => `${node.path} (predicate: ${ContentPathPredicates.every(x => x(node.path!))})`);
// core.info("### TREE ###");
// debugFiles.forEach(x => core.info(x));
// core.info("############")

const relevantTreeItems = tree.filter(node => node.path && ContentPathPredicates.every(x => x(node.path!)));

const content = await treeIt(octokit, relevantTreeItems, isLfsFile, github.context.repo, branch);
const { doi, links } = await doi$;
// const tags = (await topics$).data.names.filter(x => !TagBlacklist.includes(x.toLowerCase()));
Expand Down

0 comments on commit cd5477a

Please sign in to comment.