Skip to content

Commit

Permalink
chore(ci): use chekcout v4, use promise fs apis
Browse files Browse the repository at this point in the history
  • Loading branch information
almostSouji committed May 6, 2024
1 parent bf14346 commit ec38dfc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node20 runtime
uses: actions/setup-node@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/validateWithLinks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install node20 runtime
uses: actions/setup-node@v4
Expand Down
4 changes: 2 additions & 2 deletions src/functions/tag.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFileSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
import { dirname, join } from 'node:path';
import { fileURLToPath } from 'node:url';
import type { Collection } from '@discordjs/collection';
Expand Down Expand Up @@ -39,7 +39,7 @@ export async function loadTags(tagCache: Collection<string, Tag>, remote = false
logger.error(error, error.message);
return `# ${error.message}`;
})
: readFileSync(dir.fullPath, { encoding: 'utf8' });
: await readFile(dir.fullPath, { encoding: 'utf8' });
parts.push(file);
}

Expand Down
4 changes: 2 additions & 2 deletions src/workflowFunctions/validateTags.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { readFileSync } from 'node:fs';
import { readFile } from 'node:fs/promises';
import { dirname, join } from 'node:path';
import process from 'node:process';
import { fileURLToPath } from 'node:url';
Expand Down Expand Up @@ -51,7 +51,7 @@ export async function validateTags(
runResponseValidation: boolean,
_additionalTagData?: string,
): Promise<ValidationResult> {
const file = readFileSync(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'tags', 'tags.toml'));
const file = await readFile(join(dirname(fileURLToPath(import.meta.url)), '..', '..', 'tags', 'tags.toml'));

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

0 comments on commit ec38dfc

Please sign in to comment.