Skip to content

Commit 7227229

Browse files
committed
fix(dependabot-config): add schedule
1 parent c81a21d commit 7227229

File tree

4 files changed

+41
-53
lines changed

4 files changed

+41
-53
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ updates:
88
# Fetch and update latest `npm|yarn|pnpm` packages
99
- package-ecosystem: npm
1010
directory: /
11-
# schedule:
12-
# interval: monthly
13-
# day: monday
14-
# time: '01:00'
15-
# # UTC -03:00
16-
# timezone: America/Sao_Paulo
11+
schedule:
12+
interval: monthly
13+
day: monday
14+
time: '01:00'
15+
# UTC -03:00
16+
timezone: America/Sao_Paulo
1717
labels:
1818
- dependencies
1919
open-pull-requests-limit: 1
@@ -25,12 +25,12 @@ updates:
2525
# Fetch and update latest `github-actions` pkgs
2626
- package-ecosystem: github-actions
2727
directory: /
28-
# schedule:
29-
# interval: monthly
30-
# day: monday
31-
# time: '01:00'
32-
# # UTC -03:00
33-
# timezone: America/Sao_Paulo
28+
schedule:
29+
interval: monthly
30+
day: monday
31+
time: '01:00'
32+
# UTC -03:00
33+
timezone: America/Sao_Paulo
3434
labels:
3535
- dependencies
3636
open-pull-requests-limit: 1

packages/dependabot-config/assets/dependabot-conventional.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ updates:
88
# Fetch and update latest `npm|yarn|pnpm` packages
99
- package-ecosystem: npm
1010
directory: /
11-
# schedule:
12-
# interval: monthly
13-
# day: monday
14-
# time: '01:00'
15-
# # UTC -03:00
16-
# timezone: America/Sao_Paulo
11+
schedule:
12+
interval: monthly
13+
day: monday
14+
time: '01:00'
15+
# UTC -03:00
16+
timezone: America/Sao_Paulo
1717
labels:
1818
- dependencies
1919
open-pull-requests-limit: 1
@@ -25,12 +25,12 @@ updates:
2525
# Fetch and update latest `github-actions` pkgs
2626
- package-ecosystem: github-actions
2727
directory: /
28-
# schedule:
29-
# interval: monthly
30-
# day: monday
31-
# time: '01:00'
32-
# # UTC -03:00
33-
# timezone: America/Sao_Paulo
28+
schedule:
29+
interval: monthly
30+
day: monday
31+
time: '01:00'
32+
# UTC -03:00
33+
timezone: America/Sao_Paulo
3434
labels:
3535
- dependencies
3636
open-pull-requests-limit: 1

packages/dependabot-config/assets/dependabot.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ updates:
88
# Fetch and update latest `npm|yarn|pnpm` packages
99
- package-ecosystem: npm
1010
directory: /
11-
# schedule:
12-
# interval: monthly
13-
# day: monday
14-
# time: '01:00'
15-
# # UTC -03:00
16-
# timezone: America/Sao_Paulo
11+
schedule:
12+
interval: monthly
13+
day: monday
14+
time: '01:00'
15+
# UTC -03:00
16+
timezone: America/Sao_Paulo
1717
labels:
1818
- dependencies
1919
open-pull-requests-limit: 1
@@ -22,12 +22,12 @@ updates:
2222
# Fetch and update latest `github-actions` pkgs
2323
- package-ecosystem: github-actions
2424
directory: /
25-
# schedule:
26-
# interval: monthly
27-
# day: monday
28-
# time: '01:00'
29-
# # UTC -03:00
30-
# timezone: America/Sao_Paulo
25+
schedule:
26+
interval: monthly
27+
day: monday
28+
time: '01:00'
29+
# UTC -03:00
30+
timezone: America/Sao_Paulo
3131
labels:
3232
- dependencies
3333
open-pull-requests-limit: 1

packages/dependabot-config/index.mjs

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
11
#!/usr/bin/env node
22

3-
import childProcess from 'node:child_process'
43
import fs from 'node:fs'
54
import path from 'node:path'
6-
import { exit } from 'node:process'
7-
import { fileURLToPath } from 'node:url'
5+
import process from 'node:process'
86

97
import pkg from './package.json' with { type: 'json' }
108
import { saveFile } from './save-file.mjs'
119

12-
const __dirname = path.dirname(fileURLToPath(import.meta.url))
10+
const __dirname = path.dirname(new URL(import.meta.url).pathname)
11+
const currentPath = process.cwd()
1312
const fileName = 'dependabot.yml'
1413
let isUsingConventionalCommits = false
15-
let gitRoot
1614

1715
console.info(`[${pkg.name}] Running...`)
1816

19-
try {
20-
gitRoot = childProcess
21-
.execSync('git rev-parse --show-toplevel')
22-
.toString()
23-
.trim()
24-
} catch {
25-
console.error(`\u001B[0;31m[${pkg.name}] Could not get root path\u001B[0m`)
26-
exit()
27-
}
28-
2917
// check if uses conventional commits
3018
const installedPackages = JSON.parse(
31-
fs.readFileSync(path.join(gitRoot, 'package.json'), 'utf8'),
19+
fs.readFileSync(path.join(currentPath, 'package.json'), 'utf8'),
3220
)
3321

3422
if (
@@ -42,7 +30,7 @@ const dependabotFileName = isUsingConventionalCommits
4230
? 'dependabot-conventional.yml'
4331
: 'dependabot.yml'
4432
const dependabotSource = path.join(__dirname, 'assets', dependabotFileName)
45-
const githubDestinationFolder = path.join(gitRoot, '.github')
33+
const githubDestinationFolder = path.join(currentPath, '.github')
4634
const dependabotDestination = path.join(githubDestinationFolder, fileName)
4735

4836
saveFile({

0 commit comments

Comments
 (0)