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;
}
+2 -2
View File
@@ -373,7 +373,7 @@ Read [CONTRIBUTING.md](/CONTRIBUTING.md) to learn how to add your own repos.
*Solutions to AoC in HolyC (TempleOS).*
* [tsoding/aoc-2021](https://github.com/tsoding/aoc-2021) ![Last Commit on GitHub](https://img.shields.io/badge/last%20commit-resource%20not%20available-red)
* [tsoding/aoc-2021](https://gitlab.com/tsoding/aoc-2021)
#### Idris
@@ -602,7 +602,7 @@ Read [CONTRIBUTING.md](/CONTRIBUTING.md) to learn how to add your own repos.
* [plannapus/Advent_of_Code](https://github.com/plannapus/Advent_of_Code) ![Last Commit on GitHub](https://img.shields.io/badge/last%20commit-2021--12--11-brightgreen)
* [rrrlw/advent-of-code](https://github.com/rrrlw/advent-of-code) ![Last Commit on GitHub](https://img.shields.io/badge/last%20commit-2021--12--09-brightgreen)
* [bigfarts/aoc2021]
#### Racket
*Solutions to AoC in Racket.*