Skip to content

Commit ec38dfc

Browse files
committed
chore(ci): use chekcout v4, use promise fs apis
1 parent bf14346 commit ec38dfc

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

.github/workflows/validate.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
runs-on: macos-latest
77
steps:
88
- name: Checkout repository
9-
uses: actions/checkout@v3
9+
uses: actions/checkout@v4
1010

1111
- name: Install node20 runtime
1212
uses: actions/setup-node@v4

.github/workflows/validateWithLinks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
runs-on: macos-latest
88
steps:
99
- name: Checkout repository
10-
uses: actions/checkout@v3
10+
uses: actions/checkout@v4
1111

1212
- name: Install node20 runtime
1313
uses: actions/setup-node@v4

src/functions/tag.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFileSync } from 'node:fs';
1+
import { readFile } from 'node:fs/promises';
22
import { dirname, join } from 'node:path';
33
import { fileURLToPath } from 'node:url';
44
import type { Collection } from '@discordjs/collection';
@@ -39,7 +39,7 @@ export async function loadTags(tagCache: Collection<string, Tag>, remote = false
3939
logger.error(error, error.message);
4040
return `# ${error.message}`;
4141
})
42-
: readFileSync(dir.fullPath, { encoding: 'utf8' });
42+
: await readFile(dir.fullPath, { encoding: 'utf8' });
4343
parts.push(file);
4444
}
4545

src/workflowFunctions/validateTags.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { readFileSync } from 'node:fs';
1+
import { readFile } from 'node:fs/promises';
22
import { dirname, join } from 'node:path';
33
import process from 'node:process';
44
import { fileURLToPath } from 'node:url';
@@ -51,7 +51,7 @@ export async function validateTags(
5151
runResponseValidation: boolean,
5252
_additionalTagData?: string,
5353
): Promise<ValidationResult> {
54-
const file = readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'tags', 'tags.toml'));
54+
const file = await readFile(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'tags', 'tags.toml'));
5555

5656
const mergedData = _additionalTagData ? `${file.toString()}\n\n${_additionalTagData}` : file;
5757
const data = TOML.parse(mergedData, 1, '\n');

0 commit comments

Comments
 (0)