Skip to content

Commit 6a0d7e0

Browse files
committed
Testing again
1 parent fc696f2 commit 6a0d7e0

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

.github/actions/src/info/index.ts

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import fs from 'fs/promises';
22
import pathlib from 'path';
33
import * as core from '@actions/core';
4-
import { exec, getExecOutput } from '@actions/exec';
4+
import { getExecOutput } from '@actions/exec';
55

66
interface PackageRecord {
77
directory: string
@@ -17,7 +17,7 @@ interface PackageRecord {
1717
async function checkForChanges(directory: string) {
1818
const { exitCode } = await getExecOutput(
1919
'git',
20-
['--no-pager', 'diff', '--quiet', 'master', '--', directory],
20+
['--no-pager', 'diff', '--quiet', 'origin/master', '--', directory],
2121
{ failOnStdErr: false }
2222
);
2323
return exitCode !== 0;
@@ -36,17 +36,16 @@ async function findPackages(directory: string, maxDepth?: number) {
3636
const fullPath = pathlib.join(currentDir, item.name);
3737
if (item.isFile()) {
3838
if (item.name === 'package.json') {
39+
core.info(`Found ${fullPath}`);
3940
try {
4041
const { default: { name } } = await import(fullPath, { with: { type: 'json' }});
41-
if (name) {
42-
const changes = await checkForChanges(currentDir);
43-
yield {
44-
directory: currentDir,
45-
changes,
46-
name
47-
};
48-
return;
42+
const changes = await checkForChanges(currentDir);
43+
yield {
44+
directory: currentDir,
45+
changes,
46+
name
4947
};
48+
return;
5049
} catch {}
5150
}
5251
continue;
@@ -66,10 +65,8 @@ async function findPackages(directory: string, maxDepth?: number) {
6665
}
6766

6867
async function main() {
69-
await exec('ls -la');
70-
const gitRoot = pathlib.resolve(process.cwd());
71-
72-
core.info(`git root is ${gitRoot}`);
68+
const { stdout } = await getExecOutput('git rev-parse --show-toplevel');
69+
const gitRoot = stdout.trim();
7370

7471
const results = await Promise.all(
7572
Object.entries({

0 commit comments

Comments
 (0)