adjust action for non-github.com domains

Closes #1140
This commit is contained in:
Bogdan Popa committed 2021-12-12 09:38:38 +02:00
1 parent 4c8e771015
commit 7feed0a966
2 files changed
+10 -3

No files matched your search

+8 -1
View File
@@ -20,7 +20,9 @@ let octokit
await core.group('Fetching repositories & updating lines...', async () => {
for (const repo of repos) {
const line = await generateLine(repo.repoStr)
if (shouldUpdate(lines[repo.index], line)) {
if (otherDomain(lines[repo.index])) {
core.info(`...line refers to non-GH domain: '${lines[repo.index]}'`)
} else if (shouldUpdate(lines[repo.index], line)) {
lines[repo.index] = line
core.info(`...updated line: '${line}'`)
} else {
@@ -87,3 +89,8 @@ function shouldUpdate(oldLine, newLine) {
!badDateReg.test(newLine) ||
badDateReg.test(oldLine);
}
function otherDomain(line) {
return line.indexOf("gitlab.com") !== -1 ||
line.indexOf("gist.github.com") !== -1;
}