Commit Graph

54 Commits

Author SHA1 Message Date
Stefan Zweifel fe00d25867 Add test for multi-line commit messages 2023-01-07 12:06:10 +01:00
Stefan Zweifel aeb1802648
Add _log and _set_github_output functions (#273)
* Add _set_github_output function

* Use _set_github_output in Action

* Add _log function

* Use _log in Action and fix Test Cases

* Update wording in log messages

* Update note about removal of old output syntax

Logic is now encapuslated in a single function. I don’t mind keeping it around until spring / June 2023
2022-12-22 19:45:17 +01:00
ZeroRin 3ea6ae190b
Fix "nothing to commit" error with LF/CRLF changes #241 (#265)
* fix crlf test

* add diff check before commit

* add dirty check flag (not sure if needed)

* Update test name and add more assertions

Update test name to make it clear that the Action no longer fails to detect CRLF changes.

* Add Comment to explain why we use git-diff again

* Add test to confirm content changes are commited

* Closes #241 

Co-authored-by: Stefan Zweifel <hello@stefanzweifel.io>
2022-12-01 20:47:06 +01:00
Stefan Zweifel 0b007fbd11
Let Action fail if git binary can't be located (#261)
* Check if git binary exists

* Add Tests
2022-11-05 11:53:46 +01:00
Stefan Zweifel 0049e3fa40
Use deprecated set-output syntax if GITHUB_OUTPUT environment is not available (#255)
* Fallback to set-output if GITHUB_OUTPUT not available

* Add Tests to cover old syntax
2022-10-26 18:55:42 +02:00
Andrew Monshizadeh 2fde6fc18d
Replace set-output usage with GITHUB_OUTPUT (#252)
* GitHub has deprecated set-output and now needs to add the content to the GITHUB_OUTPUT file

* Update tests too

* Fix tests and shell-format changes

* Revert yarn.lock changes
2022-10-22 10:42:11 +02:00
Stefan Zweifel b208f78c10 Test that CRLF changes are not picked up
This PR adds a test to confirm, that changes to CRLF are not properly detected and that the message "Working tree clean. Nothing to commit." is displayed.

Setting `core.autocrlf` to `true` also has no effect here.

refs #241
2022-09-28 20:19:50 +02:00
Stefan Zweifel 4d00f10668
Expand `file_pattern`-input to an array (#205)
* Expand file_pattern input

* Expand file pattern array in git-status

* Add Failing Test

* Expand INPUT_FILE_PATTERN

* Fix Shellcheck Issues

* Add test to cover file expansion works when globbing is disabled

* Add explanation to README
2022-09-17 15:18:36 +02:00
Stefan Zweifel 4e7c0d67cd Assert throws error when force adding ignored files
See https://github.com/stefanzweifel/git-auto-commit-action/issues/204#issuecomment-1236880360
2022-09-06 21:04:34 +02:00
Stefan Zweifel dce7e85096 Add Tests to Cover #233 2022-07-30 20:21:57 +02:00
Stefan Zweifel 9262405709 Fix Typo in Test 2022-07-30 20:14:41 +02:00
Stefan Zweifel 571d6b78ed Add test to verify issue #227
This test confirms the problem mentioned in #227.

If `file_pattern` contains a pattern of, for example 2 file extensions, and only files for one extensions are dirty but not for the otherone, `git-add` will throw a fatal error.

It does not throw an error if the files for the pattern already exist but are not dirty.
2022-06-28 20:08:10 +02:00
Stefan Zweifel c4b132ec2c Update file_pattern related test 2022-02-27 12:10:20 +01:00
Stefan Zweifel ebe77391c6
Add `create_branch` option to force create a new branch (#203)
* Add create_branch option

* Checkout new branch if create_branch input is true

* Add tests

* Update README
2022-02-27 07:52:17 +01:00
Stefan Zweifel e3cb9ba079 Add Test Case 2022-01-12 21:05:06 +01:00
Chris Buckley fc174e2406 Add skip_checkout option 2022-01-10 00:17:58 +00:00
Stefan Zweifel f6048aa2ac Add Test to Cover #177
refs #177
2021-09-25 16:06:43 +02:00
Stefan Zweifel 54cc2186d1 Remove unwanted chars from tests 2021-09-10 19:47:01 +02:00
Jon Cram 68fd92dd9c Output hash of created commit 2021-09-10 14:37:45 +01:00
Tim Robertson ccad85927e
Add options for add/status commands 2021-05-03 11:26:56 -04:00
Stefan Zweifel 3053f48bdd Update Comments 2021-04-10 17:13:22 +02:00
Stefan Zweifel be370eccae Create flag to disable globbing 2021-04-10 17:10:27 +02:00
Stefan Zweifel e610a5104b Add failing test 2021-04-10 16:53:50 +02:00
Stefan Zweifel 175c2cd836 Add failing tests 2021-02-26 19:44:37 +01:00
Stefan Zweifel 75625df4f3
Revert "Feature: Create a new branch, if the given branch name doesn't exist yet" 2021-02-23 21:14:19 +01:00
Stefan Zweifel 3870982ac5 Improve Names of test repo folders 2021-02-23 20:08:01 +01:00
Stefan Zweifel 8056699617 Add Testcase 2021-02-07 15:44:12 +01:00
Stefan Zweifel 40b55695d1 Add Test 2021-01-18 20:31:50 +01:00
Stefan Zweifel a9021d5359 Add skip_fetch input option
This new option will allow users to skip the execution of `git fetch` if it has a negative impact in their workflows.

In a future PR I will probably remove the call to git-fetch interely. It was added in #108 in relation to a problem with slashes in branch names. That problem wasn't properly fixed though.
2020-12-13 09:31:16 +01:00
--global b8b8026fe4 Improve Assertions 2020-11-25 21:04:32 +01:00
--global 152b8c00c6 Move git user config 2020-11-25 20:28:15 +01:00
--global 8edcd8b718 Debug failed Workflow run 2020-11-25 20:26:43 +01:00
Stefan Zweifel 8f9132651a Update Order how git user is configured 2020-11-25 20:23:17 +01:00
Stefan Zweifel 6c72ab7799 Use git config --global to setup repo 2020-11-25 20:21:26 +01:00
Stefan Zweifel bee2ad60b0 Rewrite Tests 2020-11-25 20:18:56 +01:00
Stefan Zweifel 1e826be61c
Revert "Fix checking out branch names with / chars" 2020-10-24 11:28:52 +02:00
Stefan Zweifel 25cac34d8d
Revert "Feature: Checkout Options" 2020-10-22 07:33:38 +02:00
Stefan Zweifel 849613a3ad Add test to cover checkout-options 2020-10-15 20:23:04 +02:00
Stefan Zweifel 7f67b0b49b Rename Test 2020-10-14 20:28:01 +02:00
Stefan Zweifel 872d72f1ae Update Tests 2020-10-12 16:33:12 +02:00
Stefan Zweifel a818c89e49 Add can-work-with-empty-branch-name-and-tags test 2020-10-11 11:24:53 +02:00
Stefan Zweifel 8bf1b5695a Add can-work-with-empty-branch-name test 2020-10-11 11:21:16 +02:00
Stefan Zweifel ea30556d53 Add can-checkout-different-branch test 2020-10-11 11:21:06 +02:00
Stefan Zweifel cd7c7f1a8a Add git-push-options-are-applied test 2020-10-11 11:20:51 +02:00
Stefan Zweifel 4e16840be4 Add can-create-tag test 2020-10-11 11:20:12 +02:00
Stefan Zweifel b0295737db Add commit-user-and-author-settings-are-applied test 2020-10-11 11:20:01 +02:00
Stefan Zweifel 0d6d4a4b22 Add git-commit-options-are-applied 2020-10-11 11:19:49 +02:00
Stefan Zweifel 091b400419 Add git-add-file-pattern-is-applied test 2020-10-11 11:19:38 +02:00
Stefan Zweifel f7e362220d WIP 2020-10-11 11:19:22 +02:00
Stefan Zweifel 4f0fc14d0c Add shellmock_clean to setup method 2020-10-11 10:40:48 +02:00