Commit Graph

141 Commits

Author SHA1 Message Date
Stefan Zweifel e833d4f211
Remove _switch_to_branch function 2023-12-20 20:10:12 +01:00
Stefan Zweifel aa2cec9c08
Don't switch local branches 2023-12-19 20:11:39 +01:00
Stefan Zweifel 43818d5044
Fix Typo 2023-10-06 19:30:48 +02: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 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 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 dee58f4213 Remove nbsp from entrypoint.sh 2022-02-22 20:02:04 +01:00
Ken Odegard af49309116 Properly disambiguate between branch or file checkout 2022-01-11 10:21:56 -06:00
Chris Buckley fc174e2406 Add skip_checkout option 2022-01-10 00:17:58 +00: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 be370eccae Create flag to disable globbing 2021-04-10 17:10:27 +02:00
Stefan Zweifel f4f9aedbee Set noglob in git-auto-commit 2021-04-10 16:58:48 +02:00
Stefan Zweifel 9bb0fd2324 Push tags by using —follow-tags and —atomic
By using —follow-tags we push all annotated tags alongside the commit to the remote repository.
In addition, we’re using —atomic. This ensures that all refs are updated.

- https://github.blog/2015-04-30-git-2-4-atomic-pushes-push-to-deploy-and-more/#atomic-pushes
- https://stackoverflow.com/a/3745250
- https://therightstuff.medium.com/the-rights-and-wrongs-of-git-push-with-tags-998667eaed8f
2021-02-26 20:17:32 +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 1aee6e6b46 Make Linter Happy 2021-02-07 16:14:11 +01:00
Stefan Zweifel 94941cff88 Cleanup Code 2021-02-07 16:09:59 +01:00
Stefan Zweifel 7507738fca Use git branch --list 2021-02-07 16:07:43 +01:00
Stefan Zweifel 53438d58ce Create new branch if NAME is given 2021-02-07 15:44:48 +01:00
Stefan Zweifel b53a2f8baf Set --depth to 1 2020-12-15 20:30:42 +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
Stefan Zweifel fafea853e8 Set depth on git-fetch 2020-12-13 09:22:38 +01:00
Stefan Zweifel 983b799941 Output Commit User, Author and Message variables 2020-11-25 20:19:39 +01:00
Stefan Zweifel 4a75a2e723 Disable shellsheck for git-checkout 2020-10-24 11:33:52 +02:00
Stefan Zweifel 1e826be61c
Revert "Fix checking out branch names with / chars" 2020-10-24 11:28:52 +02:00
Stefan Zweifel 4cc90c7784 Fix Linter Errors 2020-10-22 07:37:16 +02:00
Stefan Zweifel 25cac34d8d
Revert "Feature: Checkout Options" 2020-10-22 07:33:38 +02:00
Stefan Zweifel 1ba48c6d7f Fix Linter Errors in entrypoint.sh 2020-10-15 20:30:26 +02:00
Stefan Zweifel 0ee9fb7263 Add checkout_options 2020-10-15 20:21:08 +02:00
Stefan Zweifel 6456430b6b Ignore shellchecks 2020-10-15 20:15:31 +02:00
Christian Höltje f905f00706 Fix checking out branch names with / chars
If git can't automatically figure out if the argument is a branch or
a path, it will need to be told explicitly by using `--`:

    Use '--' to separate paths from revisions, like this:
    'git <command> [<revision>...] -- [<file>...]'

Fixes: #106
2020-10-12 10:17:25 -04:00
Stefan Zweifel 4b8393320b Fetch Repo before git checkout 2020-10-10 17:54:11 +02:00
Stefan Zweifel 9e4e2e76fa
Add very basic test suite with bats and shellmock (#100)
* Add bats
* Write commits tests
* Add Workflow
* Add .gitignore
* Update Test Suite
* Disable test
* Disable failing test for now
2020-09-13 14:07:14 +02:00
Stefan Zweifel b3fc6f8a17
Revert "Creating orphan branch" 2020-09-11 11:18:24 +02:00
Daishan 505389d146 Creating orphan branch 2020-09-01 18:12:58 -07:00
Harrison Grodin 01ffd8c6f6
Only check status of files matching file_pattern 2020-08-15 22:11:45 -04:00
Stefan Zweifel c8ded2885e Simplify IF Condition 2020-06-26 21:00:48 +02:00
Stefan Zweifel f120678ed1 WIP 2020-06-25 20:40:31 +02:00
Stefan Zweifel 4183594932 WIP 2020-06-25 20:38:28 +02:00
Stefan Zweifel 49e28abb3f WIP 2020-06-25 20:31:48 +02:00
Stefan Zweifel 4ebfe28af0 Add skip_dirty_check option 2020-06-25 20:18:20 +02:00
Stefan Zweifel b0b5ed34dd Update entrypoint to handle push_options 2020-05-16 11:42:40 +02:00
Stefan Zweifel 1ee136f439 Inline user config with tag command 2020-04-28 13:12:43 +02:00
Stefan Zweifel ee9d717e46 Merge branch 'master' into fix-61
# Conflicts:
#	entrypoint.sh
2020-04-23 20:20:10 +02:00
cristianpb 2b0a9bca02
Allow to add multiple files 2020-04-23 15:55:10 +02:00
Stefan Zweifel 6e0a745133 Use Array 2020-04-22 21:17:10 +02:00