Skip to content

Commit

Permalink
Merge pull request #237 from gradle-update/cristian/fix-234
Browse files Browse the repository at this point in the history
Include all changed files after the re-run of `wrapper` task.
  • Loading branch information
cristiangreco committed Jun 15, 2021
2 parents d1ef253 + 8a99a7e commit 6d7cff0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1035,13 +1035,16 @@ class MainAction {
yield updater.update();
core.endGroup();
core.startGroup('Checking whether any file has been updated');
const modifiedFiles = yield git.gitDiffNameOnly();
let modifiedFiles = yield git.gitDiffNameOnly();
core.debug(`Modified files count: ${modifiedFiles.length}`);
core.debug(`Modified files list: ${modifiedFiles}`);
core.endGroup();
if (modifiedFiles.length) {
core.startGroup('Updating Wrapper (2nd update)');
yield updater.update();
modifiedFiles = yield git.gitDiffNameOnly();
core.debug(`Modified files count: ${modifiedFiles.length}`);
core.debug(`Modified files list: ${modifiedFiles}`);
core.endGroup();
core.startGroup('Verifying Wrapper');
yield updater.verify();
Expand Down
5 changes: 4 additions & 1 deletion src/tasks/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class MainAction {
core.endGroup();

core.startGroup('Checking whether any file has been updated');
const modifiedFiles = await git.gitDiffNameOnly();
let modifiedFiles = await git.gitDiffNameOnly();
core.debug(`Modified files count: ${modifiedFiles.length}`);
core.debug(`Modified files list: ${modifiedFiles}`);
core.endGroup();
Expand All @@ -145,6 +145,9 @@ export class MainAction {
// https://docs.gradle.org/current/userguide/gradle_wrapper.html#sec:upgrading_wrapper
core.startGroup('Updating Wrapper (2nd update)');
await updater.update();
modifiedFiles = await git.gitDiffNameOnly();
core.debug(`Modified files count: ${modifiedFiles.length}`);
core.debug(`Modified files list: ${modifiedFiles}`);
core.endGroup();

core.startGroup('Verifying Wrapper');
Expand Down

0 comments on commit 6d7cff0

Please sign in to comment.