-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Commit changes by default * Fix predicate * Add logs * Fix predicate and logs * Move no-commit logs to debug * Update README.md
- Loading branch information
Showing
3 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,26 @@ echo "running yor on directory: $INPUT_DIRECTORY" | |
/go/yor/yor tag -d "$INPUT_DIRECTORY" "$TAG_FLAG" "$TAG_GROUPS" "$SKIP_TAG_FLAG" "$SKIP_DIR_FLAG" "$EXT_TAGS_FLAG" "$OUTPUT_FLAG" | ||
rm -rf .yor_plugins | ||
YOR_EXIT_CODE=$? | ||
exit $YOR_EXIT_CODE | ||
|
||
_git_is_dirty() { | ||
[ -n "$(git status -s --untracked-files=no)" ] | ||
} | ||
|
||
if [[ $YOR_EXIT_CODE -eq 0 && $INPUT_COMMIT_CHANGES == "YES" ]] | ||
then | ||
if _git_is_dirty | ||
then | ||
echo "Yor made changes, committing" | ||
git add . | ||
git -c [email protected] -c user.email="GitHub Actions" \ | ||
commit -m "Update tags (by Yor)" \ | ||
--author="github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" ; | ||
echo "Changes committed, pushing..." | ||
git push origin | ||
fi | ||
else | ||
echo "::debug::exiting, yor failed or commit is skipped" | ||
echo "::debug::yor exit code: $YOR_EXIT_CODE" | ||
echo "::debug::commit_changes: $INPUT_COMMIT_CHANGES" | ||
exit $YOR_EXIT_CODE | ||
fi |