Skip to content

Commit 8d42b98

Browse files
committed
commit and push with bot
1 parent 7b2076d commit 8d42b98

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ target/
66
*.local
77

88

9-
.DS_Store
9+
.DS_Store
10+
.env

sepa/archiver.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ async function getRawDatasetInfo(attempts = 0) {
6767
async function saveFileIntoRepo(fileName: string, fileContent: string) {
6868
const dir = await mkdtemp("/tmp/sepa-precios-archiver-metadata-repo-");
6969
try {
70-
await $`git clone https://catdevnull:${GITHUB_TOKEN}@github.com/catdevnull/sepa-precios-metadata.git ${dir}`;
70+
await $`git clone https://catdevnull-bot:${GITHUB_TOKEN}@github.com/catdevnull/sepa-precios-metadata.git ${dir}`;
7171
await writeFile(join(dir, fileName), fileContent);
72-
await $`cd ${dir} && git config user.email "git@nulo.in" && git config user.name "github actions"`;
72+
await $`cd ${dir} && git config user.email "bot@nulo.lol" && git config user.name "github actions"`;
7373
await $`cd ${dir} && git add ${fileName}`;
7474
await $`cd ${dir} && git diff --staged --quiet || git commit -m "Update ${fileName}"`;
7575
await $`cd ${dir} && git push origin main`;
@@ -156,7 +156,10 @@ for (const resource of datasetInfo.result.resources) {
156156
await rm(zip);
157157
} catch (e) {
158158
topLevelUnzipOk = false;
159-
console.error(`⚠️ Failed to unzip top-level archive ${zip}. Keeping original and proceeding.`, e);
159+
console.error(
160+
`⚠️ Failed to unzip top-level archive ${zip}. Keeping original and proceeding.`,
161+
e
162+
);
160163
}
161164
async function unzipRecursively(dir: string) {
162165
for (const file of await readdir(dir)) {
@@ -173,7 +176,10 @@ for (const resource of datasetInfo.result.resources) {
173176
await rm(path);
174177
await unzipRecursively(extractDir);
175178
} catch (e) {
176-
console.error(`⚠️ Failed to unzip nested archive ${path}. Keeping original and continuing.`, e);
179+
console.error(
180+
`⚠️ Failed to unzip nested archive ${path}. Keeping original and continuing.`,
181+
e
182+
);
177183
}
178184
}
179185
}

0 commit comments

Comments
 (0)