Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Commit And Push Option #19

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ async function commitChanges(filesToCommit, commitMessage, git, branch) {
await git.push("repo", branch);
});
} else {
console.log("No changes to make");
core.info("No changes to make");
}
}

Expand All @@ -133,6 +133,7 @@ async function run() {
}

if (commitAndPushChanges !== false) {
core.info("Setting Commit and Push to True");
commitAndPushChanges = true;
}

Expand Down Expand Up @@ -175,12 +176,13 @@ async function run() {
// Log Changed files
core.info("Files to commit: " + JSON.stringify(filesToCommit));

if (commitAndPushChanges) {
if (commitAndPushChanges === true) {
// Generate DIff and commit changes
core.info("Attempting Committing Changes.");
await commitChanges(filesToCommit, commitMessage, git, branch);
}
} catch (error) {
console.log(error);
core.error(error);
throw error;
}
}
Expand Down
Loading