Skip to content

Commit

Permalink
feat: More debug logging
Browse files Browse the repository at this point in the history
  • Loading branch information
oprypkhantc committed Apr 29, 2024
1 parent a436c48 commit 98a1013
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/github-action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import { syncResultToReport } from "./results/result-to-report";

async function main() {
const tmpDir = process.env["RUNNER_TEMP"] || tmpdir();
console.debug(`Using ${tmpDir} for temporary files`);

const syncer = new Syncer(
new GitHubRepositorySourcer(
core.getInput("token") || null,
Expand Down
1 change: 1 addition & 0 deletions src/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export class Syncer {
constructor(private readonly repositorySourcer: RepositorySourcer) {}

async sync(sourceRoot: string): Promise<SyncResult> {
console.debug(`Using ${sourceRoot} as source root / working directory`);
const source = new Repository(sourceRoot);
const sourceConfig = await loadSourceConfig(
source.path(await source.sourceConfigFileName()),
Expand Down
4 changes: 3 additions & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export async function firstExistingPath(
for (const fileName of possibleFileNames) {
const path = join(root, fileName);

console.debug(`Checking if file exists at path ${fileName} (${path})`);

if (!(await pathExists(path))) {
continue;
}
Expand All @@ -26,6 +28,6 @@ export async function firstExistingPath(
}

throw new Error(
"Could not find file in these paths: " + possibleFileNames.join(", "),
`Could not find file in these paths: ${possibleFileNames.join(", ")}`,
);
}

0 comments on commit 98a1013

Please sign in to comment.