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

Add output for commited changes #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

danielkza
Copy link

@danielkza danielkza commented Apr 28, 2022

This allows stopping following steps if pre-commit found an issue that was auto-fixed.

@@ -93,10 +101,19 @@ async function main() {
await exec.exec('git', ['checkout', 'HEAD', '-B', branch]);

await exec.exec('git', ['commit', '-am', git_commit_message]);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -93,10 +101,19 @@ async function main() {
await exec.exec('git', ['checkout', 'HEAD', '-B', branch]);

await exec.exec('git', ['commit', '-am', git_commit_message]);


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -72,7 +80,7 @@ async function main() {
);
}
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

}
} else {
core.setOutput('committed', '');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can remove those else blocks and reduce the 3 core.submit lines to a single one

Suggested change
}
}
core.setOutput('committed', sha);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You would have to set let sha = '' earlier before line 84

@nitrocode
Copy link
Member

How does outputting the commit allow stopping following steps?

@danielkza
Copy link
Author

@nitrocode I just fail the build if commited is non-empty.

@hans-d hans-d added the stale This PR has gone stale label Mar 3, 2024
@hans-d hans-d requested a review from nitrocode March 3, 2024 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale This PR has gone stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants