Skip to content

Commit

Permalink
output info about changed
Browse files Browse the repository at this point in the history
  • Loading branch information
iautom8things committed Jun 11, 2024
1 parent 4884d87 commit 0724829
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
24 changes: 21 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4219,11 +4219,29 @@ async function run() {

if (changePath !== '') {
if (root === '') {
const changedFiles = await cmd(`git log --name-only --oneline ${versionBranch} -- ${changePath}`);
const command = `git log --name-only --oneline ${versionBranch} -- ${changePath}`;
core.info(`No tags found, checking all commits with command: ${command}`);
const changedFiles = await cmd(command);
changed = changedFiles.length > 0;
if (changed) {
core.info('No changes detected for this commit');
} else {
core.info('Changes detected for this commit');
core.info('Changed files:');
core.info(changedFiles);
}
} else {
const changedFiles = await cmd(`git diff --name-only ${root}..${versionBranch} -- ${changePath}`);
const command = `git diff --name-only ${root}..${versionBranch} -- ${changePath}`;
core.info(`Checking changes: ${command}`);
const changedFiles = await cmd(command);
changed = changedFiles.length > 0;
if (changed) {
core.info('No changes detected for this commit');
} else {
core.info('Changes detected for this commit');
core.info('Changed files:');
core.info(changedFiles);
}
}
}

Expand Down Expand Up @@ -4314,4 +4332,4 @@ run();

module.exports = __webpack_exports__;
/******/ })()
;
;
22 changes: 20 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,29 @@ async function run() {

if (changePath !== '') {
if (root === '') {
const changedFiles = await cmd(`git log --name-only --oneline ${versionBranch} -- ${changePath}`);
const command = `git log --name-only --oneline ${versionBranch} -- ${changePath}`;
core.info(`No tags found, checking all commits with command: ${command}`);
const changedFiles = await cmd(command);
changed = changedFiles.length > 0;
if (changed) {
core.info('No changes detected for this commit');
} else {
core.info('Changes detected for this commit');
core.info('Changed files:');
core.info(changedFiles);
}
} else {
const changedFiles = await cmd(`git diff --name-only ${root}..${versionBranch} -- ${changePath}`);
const command = `git diff --name-only ${root}..${versionBranch} -- ${changePath}`;
core.info(`Checking changes: ${command}`);
const changedFiles = await cmd(command);
changed = changedFiles.length > 0;
if (changed) {
core.info('No changes detected for this commit');
} else {
core.info('Changes detected for this commit');
core.info('Changed files:');
core.info(changedFiles);
}
}
}

Expand Down

0 comments on commit 0724829

Please sign in to comment.