Compare commits

...

445 Commits

Author SHA1 Message Date
Stefan Zweifel 7f171889c8
Remove removed options from README 2023-12-20 20:20:24 +01:00
Stefan Zweifel 76f415fb30
Remove skip_fetch, skip_checkout and create_branch 2023-12-20 20:19:38 +01:00
Stefan Zweifel 3e796a0146
Update Assertion 2023-12-20 20:13:20 +01:00
Stefan Zweifel e833d4f211
Remove _switch_to_branch function 2023-12-20 20:10:12 +01:00
Stefan Zweifel 0aca01a1ef
Remove no longer used input options from tests 2023-12-20 20:09:59 +01:00
Stefan Zweifel 03fddc470c
Temp disable assertions 2023-12-20 20:09:40 +01:00
Stefan Zweifel ef7ed32535
Remove no longer needed tests 2023-12-20 20:03:21 +01:00
Stefan Zweifel 9062db8404
Update Tests 2023-12-19 21:00:32 +01:00
Stefan Zweifel 80052f0645
Update Tests 2023-12-19 20:45:55 +01:00
Stefan Zweifel 3b8231379d
Update Tests 2023-12-19 20:34:56 +01:00
Stefan Zweifel d9307b5e8c
Update Test 2023-12-19 20:13:01 +01:00
Stefan Zweifel aa2cec9c08
Don't switch local branches 2023-12-19 20:11:39 +01:00
Stefan Zweifel 29183a25ec
Remove outdated docs 2023-12-12 20:45:33 +01:00
Stefan Zweifel 2818fe7949
Add Alert about pull_request_target
https://github.com/stefanzweifel/git-auto-commit-action/issues/211#issuecomment-1837270114
2023-12-12 20:42:25 +01:00
Stefan Zweifel 8d90676eef
Little Doc Updates 2023-12-12 20:38:26 +01:00
Stefan Zweifel 8036286d37
Use new Markdown Alerts in README 2023-12-12 20:38:06 +01:00
Stefan Zweifel e8f94e4dd2
Merge branch 'master' of github.com:stefanzweifel/git-auto-commit-action 2023-10-06 19:56:36 +02:00
Stefan Zweifel 98d2782f49
Use v5 in README 2023-10-06 19:56:33 +02:00
Stefan Zweifel eb38c210f2
Use v5 in update-changelog Workflow 2023-10-06 19:56:27 +02:00
stefanzweifel e27a68931b Update CHANGELOG 2023-10-06 17:55:19 +00:00
高井 8756aa072e
Update node version to node20 (#300)
Co-authored-by: ryudai.takai
2023-10-06 19:43:01 +02:00
Stefan Zweifel 17a44b07bf
Merge branch 'master' of github.com:stefanzweifel/git-auto-commit-action 2023-10-06 19:31:58 +02:00
Stefan Zweifel 43818d5044
Fix Typo 2023-10-06 19:30:48 +02:00
Stefan Zweifel 10944650cd
Use actions/checkout v4 in examples
https://github.com/stefanzweifel/git-auto-commit-action/pull/302#issuecomment-1745974288
2023-10-04 15:33:04 +02:00
dependabot[bot] 3d1b5e078a
Bump actions/checkout from 3 to 4 (#302)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-11 10:32:33 +02:00
dependabot[bot] 47a8ad5f38
Bump bats from 1.9.0 to 1.10.0 (#293)
Bumps [bats](https://github.com/bats-core/bats-core) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/bats-core/bats-core/releases)
- [Changelog](https://github.com/bats-core/bats-core/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bats-core/bats-core/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: bats
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-17 09:56:06 +02:00
dependabot[bot] 77a7b3fb3c
Bump github/super-linter from 4 to 5 (#289)
Bumps [github/super-linter](https://github.com/github/super-linter) from 4 to 5.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/v4...v5)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-06-23 09:20:59 +02:00
Pedro Amador Rodríguez 9cc0a1f55d
Seems like there is an extra space (#288) 2023-04-03 08:55:34 +02:00
Stefan Zweifel 0b5f8a5333
Update Test 2023-03-28 14:46:47 +02:00
Stefan Zweifel 3a446b74f0
Merge branch 'master' of github.com:stefanzweifel/git-auto-commit-action 2023-02-15 19:45:07 +01:00
Stefan Zweifel 8e108d701f
Fix docs about using in public forks
Update docs section about using the Action in public forks.

Add warning about current issue when the forks lives under an organisation.

Mark section about running a workflow in the head repository as outdated, as I was not able to reproduce this in test projects.

See https://github.com/stefanzweifel/git-auto-commit-action/issues/211#issuecomment-1428849944 for more details.
2023-02-15 19:44:45 +01:00
dependabot[bot] c8254de74f
Bump bats from 1.8.2 to 1.9.0 (#282)
Bumps [bats](https://github.com/bats-core/bats-core) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/bats-core/bats-core/releases)
- [Changelog](https://github.com/bats-core/bats-core/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bats-core/bats-core/compare/v1.8.2...v1.9.0)

---
updated-dependencies:
- dependency-name: bats
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-13 08:22:21 +01:00
Stefan Zweifel 6436584fbb
Fix Comment in README 2023-02-11 21:31:27 +01:00
Stefan Zweifel 6656e54255
Use actions/checkout@v3 in examples 2023-02-11 21:29:21 +01:00
Stefan Zweifel f0b35f0a73
Mention new permission requirements in usage docs
Starting February 2nd 2023, GitHub changed the default permissions of the GITHUB_TOKEN to be read-only in all new repositories.[1]

git-auto-commits needs `write`-permissions for the `contents`-key in order to work properly.
This commits updates the usage section, to mention the need for the permission requirements. The examples have also been updated to reflect that change.

[1]: https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
2023-02-11 21:29:07 +01:00
Stefan Zweifel ccd4d054a5
Fix Typo in Workflow comments 2023-02-11 21:14:56 +01:00
Stefan Zweifel 94d6bf9d22
Add permissions block to Workflows 2023-02-11 12:23:24 +01:00
Stefan Zweifel f44d1cd002
Merge branch 'master' of github.com:stefanzweifel/git-auto-commit-action 2023-01-25 19:58:10 +01:00
Stefan Zweifel 92b3981e0b
Update Author Email Address 2023-01-25 19:57:43 +01:00
Stefan Zweifel 3b94e3d017
Update README.md
Closes #281
2023-01-20 15:31:53 +01:00
Stefan Zweifel 3663a6fa3e
Update README.md 2023-01-14 18:05:16 +01:00
Stefan Zweifel fe00d25867 Add test for multi-line commit messages 2023-01-07 12:06:10 +01:00
cong 86fb2e11b2
Fix git-auto-commit.yml (#277) 2023-01-03 08:17:32 +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
stefanzweifel 925bbcaef3 Update CHANGELOG 2022-12-02 06:50:39 +00: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
Teko 976f22029f
Fix github-actions[bot] email address (#264) 2022-11-15 20:12:31 +01:00
Teko ebb5756042
Fix link and text for workflow limitation (#263) 2022-11-13 10:06:41 +01:00
stefanzweifel 3dce995a13 Update CHANGELOG 2022-11-05 10:56:08 +00: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
dependabot[bot] 7106b2184a
Bump github/super-linter from 3 to 4 (#258)
Bumps [github/super-linter](https://github.com/github/super-linter) from 3 to 4.
- [Release notes](https://github.com/github/super-linter/releases)
- [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md)
- [Commits](https://github.com/github/super-linter/compare/v3...v4)

---
updated-dependencies:
- dependency-name: github/super-linter
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-26 19:05:48 +02:00
dependabot[bot] f166130208
Bump bats from 1.7.0 to 1.8.2 (#259)
Bumps [bats](https://github.com/bats-core/bats-core) from 1.7.0 to 1.8.2.
- [Release notes](https://github.com/bats-core/bats-core/releases)
- [Changelog](https://github.com/bats-core/bats-core/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bats-core/bats-core/compare/v1.7.0...v1.8.2)

---
updated-dependencies:
- dependency-name: bats
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-26 19:04:33 +02:00
dependabot[bot] 021a6363fa
Bump actions/checkout from 2 to 3 (#257)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-26 19:03:57 +02:00
Stefan Zweifel 38864a638f
Create dependabot.yml 2022-10-26 19:02:41 +02:00
stefanzweifel 393fea59ef Update CHANGELOG 2022-10-26 16:57:18 +00: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
stefanzweifel f6f7a9c351 Update CHANGELOG 2022-10-22 09:19:59 +00: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 faf78595b8
Update README.md 2022-10-21 09:28:08 +02:00
stefanzweifel a0873a0795 Update CHANGELOG 2022-10-10 17:17:41 +00:00
Stefan Zweifel fd157da78f
Run Action on Node16 (#247)
closes #246
2022-10-10 19:15:24 +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
stefanzweifel cef08f2918 Update CHANGELOG 2022-09-24 08:53:51 +00:00
Stefan Zweifel 6c32682a40 Add bug label to new issues 2022-09-17 16:37:41 +02:00
Stefan Zweifel a4a482b6c5 Update Issue Templates 2022-09-17 16:35:49 +02:00
Stefan Zweifel 18870f2286 Add note about line break detection 2022-09-17 16:02:44 +02:00
Stefan Zweifel 52eb0eedc8 Update README 2022-09-17 15:34:02 +02:00
Karol 03246c1cee
Changed the extended example to correctly use quotes for strings (#196)
Co-authored-by: Stefan Zweifel <stefanzweifel@users.noreply.github.com>
2022-09-17 15:33:25 +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 32807d4f18 Upgrade Bats 2022-07-30 20:14:29 +02:00
Derrick Lee f5b5fefa06
docs: fix typos and grammer errors in readme.md (#235) 2022-07-27 08:23:35 +02:00
Marco f33e764001
fix typo in readme (#230)
remote was misspelled
2022-07-11 15:25:38 +02:00
Stefan Zweifel f0d72a04e7 Add note about pathspec error 2022-06-29 20:24:50 +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 f990bd0ed1 Add Note about .gitignore 2022-06-27 20:56:36 +02:00
Eric Cornelissen 789f58e41a
Add missing links in the CHANGELOG (#223)
* Update CHANGELOG

Add missing references to Pull Requests.

* Link to PRs and Authors in upcoming release notes

Co-authored-by: Stefan Zweifel <hello@stefanzweifel.io>
2022-06-06 07:36:31 +02:00
Stefan Zweifel 79ae6eea95 Update README concerning pull_request_target trigger
Closes #211
2022-04-15 20:06:11 +02:00
stefanzweifel 488db3d503 Update CHANGELOG 2022-04-12 18:43:36 +00:00
Stefan Zweifel 49620cd3ed Update README.md 2022-04-12 20:33:36 +02:00
Jonas L 73f17337ef
Use github-actions[bot] user as commit user (#213)
Fixes #212
2022-04-12 20:30:34 +02:00
Geoff 30fd9f94bc
Update README.md (#206) 2022-03-23 08:14:36 +01:00
Stefan Zweifel d0487b9fa3
Update README.md 2022-03-19 07:46:33 +01:00
stefanzweifel 2719df73cd Update CHANGELOG 2022-03-18 19:29:58 +00:00
Stefan Zweifel c4b132ec2c Update file_pattern related test 2022-02-27 12:10:20 +01:00
Stefan Zweifel 19c7b84a3c Update README 2022-02-27 11:18:39 +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 dee58f4213 Remove nbsp from entrypoint.sh 2022-02-22 20:02:04 +01:00
Stefan Zweifel 248fbacc3e
Add note about scopes for PAT 2022-01-24 16:51:53 +01:00
Stefan Zweifel 2d5591a740
Merge pull request #200 from funkyfuture/patch-1 2022-01-24 16:31:37 +01:00
Frank Sachsenheim 22695fb19e
README.md: Updates hyperlink to GH docs 2022-01-24 15:55:20 +01:00
stefanzweifel 8f6736864a Update CHANGELOG 2022-01-13 18:17:02 +00:00
Stefan Zweifel 5804e42f86
Merge pull request #199 from kenodegard/disambiguate
Properly disambiguate between branch or file checkout
2022-01-12 21:08:17 +01:00
Stefan Zweifel e3cb9ba079 Add Test Case 2022-01-12 21:05:06 +01:00
Ken Odegard af49309116 Properly disambiguate between branch or file checkout 2022-01-11 10:21:56 -06:00
Stefan Zweifel b244c38293
Update CHANGELOG.md 2022-01-10 20:28:24 +01:00
stefanzweifel c463ede7c3 Update CHANGELOG 2022-01-10 19:27:51 +00:00
Stefan Zweifel 8040434425
Merge pull request #197 from cmbuckley/skip-checkout
Add `skip_checkout` option
2022-01-10 20:11:32 +01:00
Chris Buckley fc174e2406 Add skip_checkout option 2022-01-10 00:17:58 +00:00
Stefan Zweifel 8c3ed373fb
Merge pull request #180 from ericcornelissen/docs/permissions
Add note on minimum permissions to the docs
2021-10-04 08:19:11 +02:00
Eric Cornelissen 797544dbd2 Update README.md
Add note on minimum required permission.
2021-10-03 22:18:07 +02:00
Stefan Zweifel 0d6c97e470 Update README.md 2021-09-26 11:39:31 +02:00
Stefan Zweifel f6048aa2ac Add Test to Cover #177
refs #177
2021-09-25 16:06:43 +02:00
Stefan Zweifel 983386a337 Add update-changelog Workflow 2021-09-10 19:54:41 +02:00
Stefan Zweifel b8ff4cd716 Add release-drafter Workflow 2021-09-10 19:53:48 +02:00
Stefan Zweifel abd87b7d94 Release v4.12.0 2021-09-10 19:47:39 +02:00
Stefan Zweifel 54cc2186d1 Remove unwanted chars from tests 2021-09-10 19:47:01 +02:00
Stefan Zweifel 216b25a401
Merge pull request #172 from webignition/issue-171
Output hash of created commit
2021-09-10 19:41:23 +02:00
Jon Cram 05aea7e2d9 Add commit_hash output description to readme 2021-09-10 14:37:45 +01:00
Jon Cram 68fd92dd9c Output hash of created commit 2021-09-10 14:37:45 +01:00
Stefan Zweifel 0426839718
Merge pull request #173 from webignition/run-checks-on-pull-request
Run git-auto-commit, linter and tests checks on pull requests
2021-09-10 15:32:18 +02:00
Stefan Zweifel 97badfaf41
Revert Linter to only run on push event 2021-09-10 15:31:37 +02:00
Jon Cram 10257e2994 Run git-auto-commit, linter and tests checks on pull requests 2021-09-10 13:49:19 +01:00
Stefan Zweifel e107e28c4e
Update README.md 2021-08-19 08:37:15 +02:00
Stefan Zweifel 6834afe239
Update README.md 2021-08-18 20:49:52 +02:00
Stefan Zweifel 27ac2f0a7b Update README 2021-08-18 20:43:30 +02:00
Stefan Zweifel 3568db7bbc
Add note about bash dependency 2021-07-13 20:18:17 +02:00
Stefan Zweifel 053f356774 Improve amend section in README
refs #159
2021-05-22 11:34:55 +02:00
Stefan Zweifel 46af2f08b3 Add Example for —amend to README
refs #159
2021-05-20 20:30:05 +02:00
Stefan Zweifel 5dd17c3b53 Release v4.11.0 2021-05-03 21:01:59 +02:00
Stefan Zweifel ebbf8e517a Update README 2021-05-03 20:54:47 +02:00
Stefan Zweifel 76f1ae2f1a Add Credits to README 2021-05-03 20:23:02 +02:00
Stefan Zweifel b9c536534c Add new *_options to README 2021-05-03 20:22:53 +02:00
Stefan Zweifel 68f0d95687
Merge pull request #156 from funkjedi/status-add-options
Add options for git add/status commands
2021-05-03 17:43:58 +02:00
Tim Robertson ccad85927e
Add options for add/status commands 2021-05-03 11:26:56 -04:00
Stefan Zweifel 48d37c1ffb Tag v4.10.0 2021-04-12 21:04:42 +02:00
Stefan Zweifel 4c05e3d58e
Merge pull request #154 from stefanzweifel/fixes/153
Add "disable_globbing" option to prevent shell from expanding filenames
2021-04-12 20:54:39 +02:00
Stefan Zweifel 3053f48bdd Update Comments 2021-04-10 17:13:22 +02:00
Stefan Zweifel cfd366418e Update README 2021-04-10 17:11:30 +02: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 e610a5104b Add failing test 2021-04-10 16:53:50 +02:00
Stefan Zweifel be7095c202 Release v4.9.2 2021-03-04 17:53:06 +01:00
Stefan Zweifel ae9ae1b5b8 Update Changelog 2021-03-02 20:21:56 +01:00
Stefan Zweifel e944668910
Merge pull request #146 from stefanzweifel/fixes/145
Push Tags along with Commits
2021-03-02 20:20:29 +01: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 175c2cd836 Add failing tests 2021-02-26 19:44:37 +01:00
Stefan Zweifel 296e083b4c Tag v4.9.1 2021-02-23 21:18:33 +01:00
Stefan Zweifel 871ade1c45
Merge pull request #144 from stefanzweifel/revert-140-feature/create-new-branch-during-checkout
Revert "Feature: Create a new branch, if the given branch name doesn't exist yet"
2021-02-23 21:16:57 +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 268ec0c240 Release v4.9.0 2021-02-20 20:34:30 +01:00
Stefan Zweifel 9abc4c41e5
Merge pull request #140 from stefanzweifel/feature/create-new-branch-during-checkout
Feature: Create a new branch, if the given branch name doesn't exist yet
2021-02-20 20:29:23 +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 8056699617 Add Testcase 2021-02-07 15:44:12 +01:00
Stefan Zweifel 520c63c171 Add Link to Article 2021-02-06 19:11:12 +01:00
Stefan Zweifel a6006229e0
Merge pull request #138 from stefanzweifel/test-rm-is-tracked
Add Test to verify that removed files are picked up by the Action
2021-01-18 20:34:44 +01:00
Stefan Zweifel 40b55695d1 Add Test 2021-01-18 20:31:50 +01:00
Stefan Zweifel 8f33b6cc31
Merge pull request #136 from palmerabollo/patch-1
docs: minor typo
2021-01-15 15:21:34 +01:00
Guido García c4ab3ecb7e
docs: minor typo 2021-01-15 15:19:06 +01:00
Stefan Zweifel 350754fe3a
Update LICENSE 2021-01-08 17:31:07 +01:00
Stefan Zweifel 75802d269e Release v4.8.0 2020-12-15 20:53:30 +01:00
Stefan Zweifel 5b85132a3c
Merge pull request #131 from stefanzweifel/git-fetch-depth
Set --depth on git-fetch and make call to git-fetch optional
2020-12-15 20:48:50 +01:00
Stefan Zweifel 292ae30da6 Add skip_fetch to README 2020-12-15 20:45:42 +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 6576a06e26
Merge pull request #128 from stefanzweifel/refactor/better-integration-tests
Rewrite Test Suite to no longer mock git
2020-11-25 21:11:30 +01:00
--global b104287145 Update README 2020-11-25 21:06:22 +01:00
--global b8b8026fe4 Improve Assertions 2020-11-25 21:04:32 +01:00
--global fae0e424e9 Remove old Integration Tests Workflow 2020-11-25 20:47:28 +01:00
--global a1604ef1d5 Update .gitignore 2020-11-25 20:31:12 +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 983b799941 Output Commit User, Author and Message variables 2020-11-25 20:19:39 +01:00
Stefan Zweifel bee2ad60b0 Rewrite Tests 2020-11-25 20:18:56 +01:00
Stefan Zweifel ac4585b8d5 Update Tests Workflow 2020-11-25 20:18:52 +01:00
Stefan Zweifel 4e7742676e Install bats-assert and bats-support dependencies 2020-11-25 20:18:43 +01:00
Stefan Zweifel 2e61cc5f41 Add "Used By" Badge 2020-11-02 20:14:07 +01:00
Stefan Zweifel 021e855056 Improve Wording in the Intro of the README 2020-10-28 20:27:07 +01:00
Stefan Zweifel 7cec9acee6 Improve Example 2020-10-28 20:26:58 +01:00
Stefan Zweifel bbd291750d Release v4.7.2 2020-10-24 11:41:07 +02:00
Stefan Zweifel 114a5e6044
Merge pull request #122 from stefanzweifel/revert-113-pr/complex-branches-2
Revert "Fix checking out branch names with / chars"
2020-10-24 11:36:23 +02: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 4bab898d25 Create Remote Branch before running Action 2020-10-22 19:52:43 +02:00
Stefan Zweifel 45872c3c23 Fix Typo in CHANGELOG 2020-10-22 07:38:33 +02:00
Stefan Zweifel 9b7c21583c Release v4.7.1 2020-10-22 07:37:21 +02:00
Stefan Zweifel 4cc90c7784 Fix Linter Errors 2020-10-22 07:37:16 +02:00
Stefan Zweifel 367938329d
Merge pull request #120 from stefanzweifel/revert-115-feature/checkout-options
Revert "Feature: Checkout Options"
2020-10-22 07:35:11 +02:00
Stefan Zweifel 25cac34d8d
Revert "Feature: Checkout Options" 2020-10-22 07:33:38 +02:00
Stefan Zweifel 30cd17bff0 Merge branch 'master' of github.com:stefanzweifel/git-auto-commit-action 2020-10-21 20:45:48 +02:00
Stefan Zweifel 8f5b58c89c Tag v4.7.0 2020-10-21 20:45:37 +02:00
Stefan Zweifel 65928d2898
Merge pull request #118 from stefanzweifel/tests-on-github-actions
Test Action through GitHub Actions ♾️
2020-10-17 14:59:06 +02:00
Stefan Zweifel 6b4ef1444c Add Badge 2020-10-17 14:52:58 +02:00
Stefan Zweifel 55291ea168 Rename Step 2020-10-17 14:51:58 +02:00
Stefan Zweifel 2b5c86365b Delete Remote Branch 2020-10-17 14:46:50 +02:00
Stefan Zweifel ff28943460 Add Integration Tests 2020-10-17 14:29:42 +02:00
Stefan Zweifel e3610414be Update README 2020-10-17 14:15:18 +02:00
Stefan Zweifel 042c3265d5 Update README 2020-10-17 14:14:28 +02:00
Stefan Zweifel 90cedba8bc Upgrade bats to v1.2.1 2020-10-16 19:26:44 +02:00
Stefan Zweifel b833fe0e9d
Update Code Example for pull_request_target trigger 2020-10-16 09:18:41 +02:00
Stefan Zweifel 653ea719ea Update Changelog 2020-10-15 21:15:41 +02:00
Stefan Zweifel 47c724214a
Merge pull request #115 from stefanzweifel/feature/checkout-options
Feature: Checkout Options
2020-10-15 20:36:06 +02:00
Stefan Zweifel 1ba48c6d7f Fix Linter Errors in entrypoint.sh 2020-10-15 20:30:26 +02:00
Stefan Zweifel b9e4cea0ef Disable Markdown Linter 2020-10-15 20:30:19 +02:00
Stefan Zweifel cfdb7e609e Add checkout_options to README 2020-10-15 20:26:03 +02:00
Stefan Zweifel 849613a3ad Add test to cover checkout-options 2020-10-15 20:23:04 +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
Stefan Zweifel 7f67b0b49b Rename Test 2020-10-14 20:28:01 +02:00
Stefan Zweifel 8700c3bc1c
Merge pull request #113 from docwhat/pr/complex-branches-2
Fix checking out branch names with / chars
2020-10-12 16:34:53 +02:00
Stefan Zweifel 872d72f1ae Update Tests 2020-10-12 16:33:12 +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 9c1e5d1c6a
Merge pull request #111 from francescobianco/patch-1
Update README.md
2020-10-12 08:18:24 +02:00
Francesco Bianco 18a94e4f78
Update README.md 2020-10-11 22:35:28 +02:00
Stefan Zweifel 44aeb24da7 Fix Typo in Changelog 2020-10-11 20:36:41 +02:00
Stefan Zweifel 5c9bfe7477 Tag v4.6.0 2020-10-11 20:34:17 +02:00
Stefan Zweifel 814219db13
Merge pull request #110 from Aebrathia/patch-1
Make commit_message optional #103
2020-10-11 20:16:25 +02:00
Stefan Zweifel a204abce16
Update action.yml 2020-10-11 20:14:15 +02:00
Andréa Maugars fc18df1417 Make commit_message optional 2020-10-11 15:32:07 +02:00
Stefan Zweifel 8f243393e7 Link Tests Badge 2020-10-11 11:47:09 +02:00
Stefan Zweifel fc5b9bf8cf
Merge pull request #109 from stefanzweifel/improve-testsuite
Expand existing BATS Test Suite to cover every feature
2020-10-11 11:44:48 +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 df97d6fbd8 Make testing a single test easier 2020-10-11 10:40:59 +02:00
Stefan Zweifel 4f0fc14d0c Add shellmock_clean to setup method 2020-10-11 10:40:48 +02:00
Stefan Zweifel cdf7b74cbf Fix remaining TODO test 2020-10-11 10:40:40 +02:00
Stefan Zweifel 862aa0e1e1 Update Changelog 2020-10-10 19:22:22 +02:00
Stefan Zweifel a9d1ac4f06
Merge pull request #108 from stefanzweifel/fetch-repo-before-checkout
Better support branches with special characters in them
2020-10-10 19:19:48 +02:00
Stefan Zweifel ebf8a401ee Fix Tests 2020-10-10 18:06:55 +02:00
Stefan Zweifel 4b8393320b Fetch Repo before git checkout 2020-10-10 17:54:11 +02:00
Stefan Zweifel 60c96d8c0d
Merge pull request #107 from docwhat/pr/superlinter
Use SuperLinter instead of only shellcheck
2020-10-10 16:18:15 +02:00
Stefan Zweifel 16d2bf88fd
Remove Comments from Workflow 2020-10-10 16:17:58 +02:00
Christian Holtje 54d78531cc Use SuperLinter instead of only shellcheck 2020-10-10 01:12:48 -04:00
Stefan Zweifel f922a52bf1
Use "main" as branch name in example 2020-10-06 09:13:19 +02:00
Stefan Zweifel 0bf17c328a
Fix Example using changes_detected output 2020-10-06 09:11:36 +02:00
Stefan Zweifel 240b9ad1fd Add Example on how to use Outputs 2020-10-05 19:47:23 +02:00
Stefan Zweifel 57054d8e7e
Merge pull request #101 from OskarStark/patch-1
Typo
2020-09-23 15:59:12 +02:00
Oskar Stark 613ea337db
Revert 2020-09-23 12:43:44 +02:00
Oskar Stark 686020fb2a
Typo 2020-09-23 12:43:18 +02:00
Stefan Zweifel 90b474f549 Remove unused Steps in GitHub Workflow 2020-09-13 14:21:10 +02:00
Stefan Zweifel 8c26230a11 Update git config if not set yet 2020-09-13 14:18:41 +02:00
Stefan Zweifel 961d68003e Add yarn.lock to .gitignore 2020-09-13 14:15:28 +02:00
Stefan Zweifel cbc3d50cea Add Badge 2020-09-13 14:11:23 +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 09aaf2d8fa Update Changelog 2020-09-11 11:22:22 +02:00
Stefan Zweifel c7ad0bdb15 Release v4.5.1 2020-09-11 11:20:33 +02:00
Stefan Zweifel 9cb711878d
Merge pull request #98 from stefanzweifel/revert-95-master
Revert "Creating orphan branch"
2020-09-11 11:19:07 +02:00
Stefan Zweifel b3fc6f8a17
Revert "Creating orphan branch" 2020-09-11 11:18:24 +02:00
Stefan Zweifel d51384f592 Revert "Update Workflow"
This reverts commit 4e7ddef1e0.
2020-09-10 19:54:30 +02:00
Stefan Zweifel 4e7ddef1e0 Update Workflow 2020-09-10 19:51:32 +02:00
Stefan Zweifel cc7755497c Release v4.5.0 2020-09-10 19:48:26 +02:00
Stefan Zweifel 5c3c72f20e
Merge pull request #95 from StrongMonkey/master
Creating orphan branch
2020-09-10 19:44:31 +02:00
Daishan 505389d146 Creating orphan branch 2020-09-01 18:12:58 -07:00
Stefan Zweifel 303ce37181
Merge pull request #93 from stefanzweifel/add-note-about-forks
Update README with instructions for forks
2020-08-22 14:45:20 +02:00
Stefan Zweifel 13efc066dd Small little improvements 2020-08-22 14:42:29 +02:00
Stefan Zweifel 3c204cdee3
Update README.md 2020-08-22 14:21:01 +02:00
Stefan Zweifel 0429047166 Update README with instructions for forks
GitHub recently introduced ways for Actions to run on forks.

This update now finally allows repository maintainers to write Workflows to run code linters and fixers which can also work on the forks.
2020-08-22 14:13:11 +02:00
Stefan Zweifel 09d3315401 Update Versioning Workflow 2020-08-16 20:05:44 +02:00
Stefan Zweifel 1f4914882d Release v4.4.1 2020-08-16 20:03:54 +02:00
Stefan Zweifel b5320678c1
Merge pull request #91 from HarrisonGrodin/patch-1
Only check status of files matching file_pattern
2020-08-16 19:31:45 +02:00
Harrison Grodin 01ffd8c6f6
Only check status of files matching file_pattern 2020-08-15 22:11:45 -04:00
Stefan Zweifel 5222c758dd Add FUNDING.yml 2020-07-29 13:22:07 +02:00
Stefan Zweifel bbcb72b1e9 Update README 2020-07-26 12:53:22 +02:00
Stefan Zweifel 142eb9509a Update README 2020-07-24 21:11:32 +02:00
Stefan Zweifel 0233fee872 Update Protected Branch Section in README 2020-07-24 20:59:16 +02:00
Stefan Zweifel 808edcd96b Add links to pathspec documentation 2020-07-24 20:44:56 +02:00
Stefan Zweifel 1b1d53f462 Move Inputs and Outputs 2020-07-24 20:24:23 +02:00
Stefan Zweifel ee93725e66
Merge pull request #86 from TGTGamer/master
Docs: #85 Add small information about command line options
2020-07-18 13:50:16 +02:00
Jonathan S 36304edfd2
Update README.md 2020-07-18 12:42:58 +01:00
Stefan Zweifel ff97e958aa
Update README.md 2020-07-16 11:03:50 +02:00
Stefan Zweifel 90282bf5e2 Release v4.4.0 2020-06-26 21:07:28 +02:00
Stefan Zweifel c9eb2132b2
Merge pull request #84 from stefanzweifel/feature/skip-dirty-check
Add a "Skip Dirty Check" Option
2020-06-26 21:02:58 +02: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 984a26d893 Update link to versioning info in README 2020-05-17 10:20:34 +02:00
Stefan Zweifel 3804c79d2e Add Versioning GitHub Actions 2020-05-17 10:08:37 +02:00
Stefan Zweifel 69a12041a1 Release v4.3.0 2020-05-16 13:47:17 +02:00
Stefan Zweifel 91b7d20ead
Merge pull request #78 from stefanzweifel/feature/push-options
Feature: Push Options
2020-05-16 13:30:24 +02:00
Stefan Zweifel 044b6b777c Fix Typo 2020-05-16 13:26:59 +02:00
Stefan Zweifel 9aab2f8a5c Add example for protected branches 2020-05-16 13:22:34 +02:00
Stefan Zweifel 0280d2ccee Add push_options to README 2020-05-16 13:17:00 +02:00
Stefan Zweifel b0b5ed34dd Update entrypoint to handle push_options 2020-05-16 11:42:40 +02:00
Stefan Zweifel ae38c94802 Add push_options to action.yml 2020-05-16 11:42:24 +02:00
Stefan Zweifel 3aae7bb63f Remove continous-deployment.yml 2020-05-16 11:24:57 +02:00
Stefan Zweifel c180c695f2 Release v4.2.0 2020-05-10 13:16:25 +02:00
Stefan Zweifel c1a70c9013 Update Changelog 2020-05-10 13:12:24 +02:00
Stefan Zweifel 02c4f2cf78
Merge pull request #73 from spawnia/restructure-readme
Bundle limitations and gotchas together in the README.md
2020-05-10 13:11:32 +02:00
Stefan Zweifel 3c687aa8ba Replace head_ref with branch name example 2020-05-10 13:09:18 +02:00
spawnia a69eabaead clarify branch option 2020-05-10 12:55:07 +02:00
spawnia 9f2c45c9eb Remove unneeded hints to re-specify the default branch 2020-05-10 12:51:21 +02:00
spawnia 5bf88dc2fd Merge branch 'master' into restructure-readme 2020-05-10 12:48:11 +02:00
Stefan Zweifel fd2aab7c5b
Merge pull request #75 from stefanzweifel/use-head-ref-as-default-value
Use github.head_ref as branch default value
2020-05-10 12:31:26 +02:00
Stefan Zweifel f342c95aa2 Use github.head_ref as branch default value 2020-05-09 12:44:07 +02:00
Benedikt Franke 1157d7bbe9 Shorten 2020-05-06 00:22:05 +02:00
Benedikt Franke 58b79711d8 Add example 2020-05-06 00:21:35 +02:00
Benedikt Franke f5f76eb1f4 Consolidate more 2020-05-06 00:00:33 +02:00
Benedikt Franke 5513d18f64 Bundle limitations and gotchas together in the README.md 2020-05-05 23:54:32 +02:00
Stefan Zweifel 6ef5688e81 Update bug_report.md 2020-05-01 12:56:39 +02:00
Stefan Zweifel e02ededdeb Update README with instructions and limitations
Closes #69
2020-05-01 12:56:23 +02:00
Stefan Zweifel 2f5e73df85 Release v4.1.6 2020-04-28 13:28:19 +02:00
Stefan Zweifel cc16347545
Merge pull request #68 from stefanzweifel/fix-67
Inline User Configuration when creating a Tag
2020-04-28 13:27:03 +02:00
Stefan Zweifel 1ee136f439 Inline user config with tag command 2020-04-28 13:12:43 +02:00
Stefan Zweifel 7fdc480651
Update README.md 2020-04-24 10:14:37 +02:00
Stefan Zweifel 394681d465 Release v4.1.5 2020-04-23 20:46:50 +02:00
Stefan Zweifel a261484cc8 Update file_pattern Example in README 2020-04-23 20:46:41 +02:00
Stefan Zweifel 43ed630979
Merge pull request #64 from stefanzweifel/fix-61
Fix Issue with Commit Options
2020-04-23 20:35:56 +02:00
Stefan Zweifel ee9d717e46 Merge branch 'master' into fix-61
# Conflicts:
#	entrypoint.sh
2020-04-23 20:20:10 +02:00
Stefan Zweifel 68b94ecdf3
Merge pull request #65 from cristianpb/master
 Allow to add multiple files
2020-04-23 16:20:11 +02:00
cristianpb 2b0a9bca02
Allow to add multiple files 2020-04-23 15:55:10 +02:00
Stefan Zweifel 13c9c82cae
Merge pull request #63 from stefanzweifel/revert-62-revert-59-no-override-global-git
Revert "Revert "Place git user configuration inline before commit""
2020-04-22 21:20:00 +02:00
Stefan Zweifel 6e0a745133 Use Array 2020-04-22 21:17:10 +02:00
Stefan Zweifel 88ddd5fba5 WIP 2020-04-22 21:04:17 +02:00
Stefan Zweifel 2dec151b5c WIP 2020-04-22 20:49:36 +02:00
Stefan Zweifel 1ba0b8765f WIP 2020-04-22 20:43:52 +02:00
Stefan Zweifel f278d451d8 Revert hard coded options 2020-04-22 20:39:17 +02:00
Stefan Zweifel 1f6bf5e4c0 Set default value for commit_options 2020-04-22 20:39:08 +02:00
Stefan Zweifel 5dae7dbdb7 Hard Code Options 2020-04-22 20:36:26 +02:00
Stefan Zweifel fbbf9665a8 Output git version and debugging message 2020-04-22 20:21:08 +02:00
Stefan Zweifel e8ab63a01b Add ; in more places 2020-04-22 20:17:05 +02:00
Stefan Zweifel fdbf836519 Split git-commit command 2020-04-22 20:07:31 +02:00
Stefan Zweifel 8f94f9b7ec
Revert "Revert "Place git user configuration inline before commit"" 2020-04-22 20:04:52 +02:00
Stefan Zweifel e6db1ef8bd Release v4.1.4 2020-04-22 12:58:51 +02:00
Stefan Zweifel d09082150e
Merge pull request #62 from stefanzweifel/revert-59-no-override-global-git
Revert "Place git user configuration inline before commit"
2020-04-22 12:56:36 +02:00
Stefan Zweifel 3e578b5696
Revert "Place git user configuration inline before commit" 2020-04-22 12:55:25 +02:00
Stefan Zweifel c586963a3d Update README 2020-04-18 10:55:30 +02:00
Stefan Zweifel a7342eab13 Release v4.1.3 2020-04-18 10:55:26 +02:00
Stefan Zweifel 256f31683d Add some Debug Logs 2020-04-18 10:53:20 +02:00
Stefan Zweifel 8040ba33d6
Merge pull request #59 from parndt/no-override-global-git
Place git user configuration inline before commit
2020-04-10 14:50:57 +02:00
Philip Arndt 80c7ed953f
Place git user configuration inline 2020-04-10 11:38:03 +12:00
Stefan Zweifel dd055f6225 Release v4.1.2 2020-04-03 09:19:39 +02:00
Stefan Zweifel 55734408b7
Merge pull request #57 from wxt2005/master
Remove unnecessary escape
2020-04-03 09:10:34 +02:00
Botao d317154f77 Remove unnecessary escape 2020-04-03 13:21:53 +08:00
Stefan Zweifel 36489f4cb5
Merge pull request #56 from localheinz/patch-1
Fix: Typo
2020-03-17 15:44:10 +01:00
Andreas Möller 2530046e72
Fix: Typo 2020-03-17 13:44:47 +01:00
Stefan Zweifel 172c2a2fc3 Update CD Workflow 2020-03-14 13:39:33 +01:00
Stefan Zweifel 480e111bf8 Release v4.1.1 2020-03-14 13:37:49 +01:00
Stefan Zweifel 7659782c71
Merge pull request #54 from stefanzweifel/hotfix/optional-branch-push
Fix: Push branch to repository if no branch name is given and no tagging message is set
2020-03-14 13:34:39 +01:00
Stefan Zweifel 026f88c27c Fix typo in message 2020-03-14 13:32:10 +01:00
Stefan Zweifel f73d11d461 Revert changes 2020-03-14 13:21:42 +01:00
Stefan Zweifel 2b6b90e8f1 Test shorthand 2020-03-14 13:20:32 +01:00
Stefan Zweifel e1770ec52b Only add --tags option if tagging message is set 2020-03-14 13:13:34 +01:00
Stefan Zweifel 0453bb1c25 Temp disable push of tags 2020-03-14 13:11:13 +01:00
Stefan Zweifel da55e4a0cf Add echo statements for easier debugging 2020-03-14 13:09:53 +01:00
Stefan Zweifel b1833bd054
Merge pull request #52 from localheinz/fix/typo
Fix: Typo
2020-03-13 17:02:58 +01:00
Andreas Möller 6dfda22dd6
Fix: Typo 2020-03-13 12:35:11 +01:00
Stefan Zweifel 94c72aa7c5 Update Changelog and Readme for v4.1.0 2020-03-05 20:55:10 +01:00
Stefan Zweifel 87526a8aa1
Merge pull request #50 from stefanzweifel/feature/tag-commit
Feature: Tag commit created by the Action
2020-03-05 20:52:29 +01:00
Stefan Zweifel 844c808726 Echo out the tagging message 2020-03-05 20:48:15 +01:00
Stefan Zweifel ce08dda6b3 Update Wording 2020-03-05 20:48:00 +01:00
Stefan Zweifel 0ad4c8ce73 Fix _tag_commit 2020-03-05 20:35:32 +01:00
Stefan Zweifel 3387b2f267 Add tagging_message input option 2020-03-05 20:31:06 +01:00
Stefan Zweifel d4a53f1779 Push Tags to Remote Repository 2020-03-05 20:28:38 +01:00
Stefan Zweifel 956a47433b
Merge pull request #49 from stefanzweifel/feature/outputs
Feature: Add "changes_detected" output
2020-03-04 20:44:32 +01:00
Stefan Zweifel f866b2a854 Update Changelog 2020-03-04 20:33:53 +01:00
Stefan Zweifel 8744cc88ef Update README 2020-03-04 20:33:10 +01:00
Stefan Zweifel 57bbd38e56 Add outputs to action.yml 2020-03-04 19:56:33 +01:00
Stefan Zweifel eef5f33ea3 WIP 2020-03-03 21:04:57 +01:00
Stefan Zweifel 25e6f0b17d Echo changes_detected in workflow 2020-03-03 21:00:40 +01:00
Stefan Zweifel ae885f5d8c WIP 2020-03-03 20:54:12 +01:00
Stefan Zweifel 33e8fd937f Add changes_detected output 2020-03-03 20:51:12 +01:00
Stefan Zweifel 404d2015f4 Add Workflow to run git-auto-commit 2020-03-03 20:51:02 +01:00
Stefan Zweifel cd0530ad7a
Merge pull request #48 from clxmstaab/patch-1
example: fix typo
2020-03-03 12:12:50 +01:00
Markus Staab 2a957f5c41
example: fix typo 2020-03-03 12:08:03 +01:00
Stefan Zweifel 7e64e614a1 Fix Typo in README 2020-02-29 09:52:12 +01:00
Stefan Zweifel c887fa4a07 Update Changelog 2020-02-24 20:09:19 +01:00
Stefan Zweifel 09d175379e Release v4.0.0 2020-02-24 20:03:49 +01:00
Stefan Zweifel cdb861eda0
Merge pull request #45 from stefanzweifel/refactor/switch-to-js
[4.0] Switch to NodeJS Environment (BC)
2020-02-24 19:49:08 +01:00
Stefan Zweifel 6a853b60cc Add Continuous Deployment Workflow 2020-02-24 19:39:11 +01:00
Stefan Zweifel 76f50fc3ad Add PAT Example 2020-02-23 11:42:57 +01:00
Stefan Zweifel 9b4acb8f10 Update README 2020-02-23 11:29:03 +01:00
Stefan Zweifel d11ccd183d Add commetn to index.js
I don't have so much experience in writing node-js scripts. It makes sense, to point out where most of the code in index.js is coming from.
2020-02-23 10:45:28 +01:00
Stefan Zweifel a156a1072e Remove not required code 2020-02-23 10:44:44 +01:00
Stefan Zweifel d69e5f0850 WIP 2020-02-23 10:16:26 +01:00
Stefan Zweifel 86f0c11c06 Remove dist/index.js 2020-02-11 21:08:14 +01:00
Stefan Zweifel eda98fb9e5 Simplify index.js 2020-02-11 21:04:18 +01:00
Stefan Zweifel 844e852dde Add @actions/exec 2020-02-11 21:00:40 +01:00
Stefan Zweifel cca75e0840 Add compiled index.js file 2020-02-11 20:54:10 +01:00
Stefan Zweifel ef107e1d4b Switch Action to use node12 2020-02-11 20:50:33 +01:00
Stefan Zweifel e97d20ce65 Add package.json and other JavaScript related files 2020-02-11 20:50:22 +01:00
Stefan Zweifel 3c9d7dd29d Remove Dockerfile 2020-02-11 20:47:37 +01:00
Stefan Zweifel 4ff392a586
Merge pull request #42 from zhangyoufu/patch-1
fix typo in README.md
2020-02-08 07:50:13 +01:00
Youfu Zhang 69c53bd75e
fix typo in README.md 2020-02-08 12:28:25 +08:00
Stefan Zweifel 8563bc2c47 Tag v3.0.0 2020-02-06 21:15:35 +01:00
Stefan Zweifel 657dcb0873
Merge pull request #40 from stefanzweifel/v3
Release: v3.0.0
2020-02-06 21:14:31 +01:00
Stefan Zweifel 1d39bb676c
Merge pull request #41 from stefanzweifel/feature/make-branch-optional
Make branch option optional
2020-02-06 20:51:13 +01:00
Stefan Zweifel 864c975b87 Update README 2020-02-06 20:49:03 +01:00
Stefan Zweifel 33592697c4 Update Changelog 2020-02-06 20:43:04 +01:00
Stefan Zweifel 13e281008a Update entrypoint.sh 2020-02-06 17:51:55 +01:00
Stefan Zweifel 42e5be9ebb WIP 2020-02-05 21:39:14 +01:00
Stefan Zweifel f0354eba45 WIP 2020-02-05 21:36:48 +01:00
Stefan Zweifel af7b14b2cf WIP 2020-02-05 21:32:57 +01:00
Stefan Zweifel 5a4e81ccd7 WIP 2020-02-05 21:31:46 +01:00
Stefan Zweifel 0884c39e7e WIP 2020-02-05 21:28:18 +01:00
Stefan Zweifel 5ab45a4eef WIP 2020-02-05 21:26:30 +01:00
Stefan Zweifel e20b39e8ed Remove branch default value 2020-02-05 21:24:36 +01:00
Stefan Zweifel 5df30c89b8 Update how commit is pushed 2020-02-05 21:22:54 +01:00
Stefan Zweifel b197c5ff8c Set default value for branch 2020-02-05 21:12:20 +01:00
Stefan Zweifel 098f1a8051
Merge pull request #39 from stefanzweifel/feature/commiter-options
Add Options to change Commit User Name and Email and Author
2020-02-05 20:38:20 +01:00
Stefan Zweifel a06032e34f Update Changelog 2020-02-05 20:36:12 +01:00
Stefan Zweifel 3185f2bd2a Update README 2020-02-05 20:27:14 +01:00
Stefan Zweifel 5432544bdb Update Docs 2020-02-05 20:24:25 +01:00
Stefan Zweifel 0a5fd7e510 Merge branch 'v3' into feature/commiter-options
# Conflicts:
#	README.md
#	entrypoint.sh
2020-02-05 20:12:29 +01:00
Stefan Zweifel 81fa501ea5
Merge pull request #36 from stefanzweifel/refactor/remove-git-setup
Remove need for GITHUB_TOKEN
2020-02-05 19:52:36 +01:00
Stefan Zweifel 3c60dc19b2 Update README 2020-02-04 21:27:15 +01:00
Stefan Zweifel 0822a9b930 Add commit_author input option 2020-02-04 21:02:40 +01:00
Stefan Zweifel d47024e59c Add commit_user_name and commit_user_email inputs 2020-02-04 20:14:27 +01:00
Stefan Zweifel ae384f95d0 Update Changelog 2020-02-04 19:43:08 +01:00
Stefan Zweifel 959e7d4eab Update README 2020-02-04 19:42:37 +01:00
Stefan Zweifel b21b1abc6d Update Comment 2020-02-04 19:37:58 +01:00
Stefan Zweifel 35440b9386 Update README 2020-02-04 19:37:00 +01:00
Stefan Zweifel 99f6ce74b4
Update README.md 2020-01-14 14:44:34 +01:00
Stefan Zweifel 4ab94c0ec4 Remove creation of .netrc file 2020-01-13 21:23:03 +01:00
Stefan Zweifel 1a9ba81dae
Merge pull request #32 from yelizariev/patch-2
delete args as not used
2020-01-11 21:40:52 +01:00
Stefan Zweifel 2043118160 Update Dockerfile 2020-01-11 21:35:29 +01:00
Stefan Zweifel 9879efa581
Merge pull request #34 from yelizariev/refactoring
refactoring: combine merge lib.sh to entrypoint.sh
2020-01-11 21:34:15 +01:00
Stefan Zweifel 3525430c70 Update README 2020-01-11 21:32:17 +01:00
Stefan Zweifel db25cb8fde Add checkout@v2 example
Closes #33
2020-01-11 21:32:11 +01:00
Ivan Yelizariev 5dd90bb58c
refactoring: combine merge lib.sh to entrypoint.sh
If we use "source /lib.sh", bash will point to wrong line in case of an error.
It's confusing on debuggin new features
2020-01-10 13:08:35 +05:00
Ivan Yelizariev 36610a4da0
delete args as not used
closes #31
2020-01-07 12:27:14 +05:00
Stefan Zweifel 26a56d2023 Add note to README about forks and PRs 2020-01-04 17:54:44 +01:00
Stefan Zweifel 6d7a33192e Release v2.5.0 2019-12-18 11:59:49 +01:00
Stefan Zweifel d625ec8b28 Update Description of inputs 2019-12-18 11:58:17 +01:00
Stefan Zweifel e870f94840 Update Changelog 2019-12-18 11:57:16 +01:00
Stefan Zweifel 4a6ffd0603
Merge pull request #24 from stefanzweifel/extract-logic-to-lib
Extract methods into lib.sh / Add shellcheck workflow
2019-12-16 14:57:24 +01:00
Stefan Zweifel dcfe3115ff WIP 2019-12-12 21:40:03 +01:00
Stefan Zweifel 3f6e990b1e Update lib.sh 2019-12-12 21:14:38 +01:00
Stefan Zweifel 560cf49647 Update Workflow 2019-12-12 21:10:29 +01:00
Stefan Zweifel c62363dd62 Add Workflow to run Shellcheck 2019-12-12 21:05:01 +01:00
Stefan Zweifel 7c85ce3dee Update path to lib.sh 2019-12-12 20:46:16 +01:00
Stefan Zweifel 8bb153baaa Update Dockerfile 2019-12-12 20:45:42 +01:00
Stefan Zweifel 68035425ff Update Path 2019-12-12 20:44:41 +01:00
Stefan Zweifel 3273c330f8 Fix path 2019-12-12 20:42:47 +01:00
Stefan Zweifel 4280601118 Create lib.sh and update entrypoint.sh 2019-12-12 20:41:00 +01:00
Stefan Zweifel 3c148f8a94
Merge pull request #22 from yelizariev/custom-repo-path
Add "repository" option for custom repository path
2019-12-10 20:20:25 +01:00
Ivan Yelizariev d3ceacae7d
Add "repository" option for custom repository path 2019-12-10 17:20:25 +05:00
Stefan Zweifel d338d7dd00 Update README to latest version 2019-11-30 19:42:53 +01:00
25 changed files with 2370 additions and 154 deletions

2
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,2 @@
github: stefanzweifel
custom: ["https://buymeacoff.ee/3oQ64YW"]

64
.github/ISSUE_TEMPLATE/bug.yaml vendored Normal file
View File

@ -0,0 +1,64 @@
name: Bug Report
description: If you've already asked for help with a problem and confirmed something is broken with git-auto-commit itself, create a bug report.
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Before opening a bug report, please search for the behaviour in the existing issues.
---
Thank you for taking the time to file a bug report!
- type: input
id: git-auto-commit-version
attributes:
label: git-auto-commit Version
description: "Which exact version of git-auto-commit are you using in your Workflow?"
placeholder: "v4.14.0"
validations:
required: true
- type: dropdown
id: machine
attributes:
label: Machine Type
description: On which type of machine is your workflow running?
options:
- Ubuntu (eg. ubuntu-latest)
- macOS (eg. macos-latest)
- Windows (Not supported!)
validations:
required: true
- type: textarea
id: bug-description
attributes:
label: Bug description
description: What exactly happened?
validations:
required: true
- type: textarea
id: steps
attributes:
label: Steps to reproduce
description: Which steps do we need to take to reproduce this error?
validations:
required: true
- type: textarea
id: tried-solutions
attributes:
label: Tried solutions
description: Have you tried solving the issue by adapting your Workflow? What steps did you take?
- type: textarea
id: example-workflow
attributes:
label: Example Workflow
description: Please share your GitHub Actions workflow which causes the bug. We use this to reproduce the error. No need for backticks here.
render: yaml
validations:
required: true
- type: textarea
id: logs
attributes:
label: Relevant log output
description: If applicable, provide relevant log output. No need for backticks here.
render: shell

View File

@ -1,30 +0,0 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Version of the Action**
`v2.x.x`
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Additional context**
Add any other context about the problem here.

8
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,8 @@
blank_issues_enabled: false
contact_links:
- name: Get Help
url: https://github.com/stefanzweifel/git-auto-commit-action/discussions/new?category=help
about: If you can't get something to work the way you expect, open a question in our discussion forums.
- name: Feature Request
url: https://github.com/tailwindlabs/tailwindcss/discussions/new?category=ideas
about: 'Suggest any ideas you have using our discussion forums.'

View File

@ -1,20 +0,0 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

10
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

45
.github/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,45 @@
ame-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
change-template: '- $TITLE ([#$NUMBER](https://github.com/stefanzweifel/git-auto-commit-action/pull/$NUMBER)) [@$AUTHOR](https://github.com/@$AUTHOR)'
template: |
$CHANGES
categories:
- title: Added
labels:
- 'changelog:added'
- title: Changed
labels:
- 'changelog:changed'
- title: Deprecated
labels:
- 'changelog:deprecated'
- title: Removed
labels:
- 'changelog:removed'
- title: Fixed
labels:
- 'changelog:fixed'
- title: Security
labels:
- security
- changelog:security
- title: 'Dependency Updates'
labels:
- dependencies
version-resolver:
major:
labels:
- 'changelog:removed'
minor:
labels:
- 'changelog:added'
- 'changelog:deprecated'
patch:
labels:
- 'changelog:fixed'
- 'changelog:security'
- 'dependency'
exclude-labels:
- 'skip-changelog'

31
.github/workflows/git-auto-commit.yml vendored Normal file
View File

@ -0,0 +1,31 @@
name: git-auto-commit
on:
push:
branches:
- master
pull_request:
jobs:
git-auto-commit:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
steps:
- uses: actions/checkout@v4
- name: Use git-auto-commit-action
id: "auto-commit-action"
uses: ./
- name: "no changes detected"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: "echo \"No changes detected\""
- name: "changes detected"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: "echo \"Changes detected\""

20
.github/workflows/linter.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Lint Code Base
on: push
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Lint Code Base
uses: github/super-linter@v5
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_MARKDOWN: false
DEFAULT_BRANCH: master
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

20
.github/workflows/release-drafter.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: Release Drafter
on:
push:
branches:
- master
jobs:
update_release_draft:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
steps:
- uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

20
.github/workflows/tests.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: tests
on:
push:
branches:
- master
pull_request:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install testing dependencies
run: yarn install
- name: Run Tests
run: yarn test

34
.github/workflows/update-changelog.yaml vendored Normal file
View File

@ -0,0 +1,34 @@
name: "Update Changelog"
on:
release:
types: [released]
jobs:
update:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# updated CHANGELOG back to the repository.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: master
- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
release-notes: ${{ github.event.release.body }}
latest-version: ${{ github.event.release.name }}
- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: master
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md

21
.github/workflows/versioning.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Keep the versions up-to-date
on:
release:
types: [published, edited]
jobs:
actions-tagger:
runs-on: windows-latest
permissions:
# Give the default GITHUB_TOKEN write permission.
# https://github.blog/changelog/2023-02-02-github-actions-updating-the-default-github_token-permissions-to-read-only/
contents: write
steps:
- uses: Actions-R-Us/actions-tagger@latest
env:
GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
with:
publish_latest_tag: true

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
tests/test_fake_local_repository
tests/test_fake_remote_repository
tests/test_fake_temp_local_repository
yarn.lock

View File

@ -1,48 +1,362 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.4.0...HEAD)
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v5.0.0...HEAD)
> TBD
## [v5.0.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.16.0...v5.0.0) - 2023-10-06
New major release that bumps the default runtime to Node 20. There are no other breaking changes.
### Changed
- Update node version to node20 ([#300](https://github.com/stefanzweifel/git-auto-commit-action/pull/300)) [@ryudaitakai](https://github.com/@ryudaitakai)
- Add _log and _set_github_output functions ([#273](https://github.com/stefanzweifel/git-auto-commit-action/pull/273)) [@stefanzweifel](https://github.com/@stefanzweifel)
### Fixed
- Seems like there is an extra space ([#288](https://github.com/stefanzweifel/git-auto-commit-action/pull/288)) [@pedroamador](https://github.com/@pedroamador)
- Fix git-auto-commit.yml ([#277](https://github.com/stefanzweifel/git-auto-commit-action/pull/277)) [@zcong1993](https://github.com/@zcong1993)
### Dependency Updates
- Bump actions/checkout from 3 to 4 ([#302](https://github.com/stefanzweifel/git-auto-commit-action/pull/302)) [@dependabot](https://github.com/@dependabot)
- Bump bats from 1.9.0 to 1.10.0 ([#293](https://github.com/stefanzweifel/git-auto-commit-action/pull/293)) [@dependabot](https://github.com/@dependabot)
- Bump github/super-linter from 4 to 5 ([#289](https://github.com/stefanzweifel/git-auto-commit-action/pull/289)) [@dependabot](https://github.com/@dependabot)
- Bump bats from 1.8.2 to 1.9.0 ([#282](https://github.com/stefanzweifel/git-auto-commit-action/pull/282)) [@dependabot](https://github.com/@dependabot)
## [v4.16.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.4...v4.16.0) - 2022-12-02
### Changed
- Don't commit files when only LF/CRLF changes ([#265](https://github.com/stefanzweifel/git-auto-commit-action/pull/265)) [@ZeroRin](https://github.com/@ZeroRin)
- Update default email address of github-actions[bot] ([#264](https://github.com/stefanzweifel/git-auto-commit-action/pull/264)) [@Teko012](https://github.com/@Teko012)
### Fixed
- Fix link and text for workflow limitation ([#263](https://github.com/stefanzweifel/git-auto-commit-action/pull/263)) [@Teko012](https://github.com/@Teko012)
## [v4.15.4](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.3...v4.15.4) - 2022-11-05
### Fixed
- Let Action fail if git binary can't be located ([#261](https://github.com/stefanzweifel/git-auto-commit-action/pull/261)) [@stefanzweifel](https://github.com/@stefanzweifel)
### Dependency Updates
- Bump github/super-linter from 3 to 4 ([#258](https://github.com/stefanzweifel/git-auto-commit-action/pull/258)) [@dependabot](https://github.com/@dependabot)
- Bump bats from 1.7.0 to 1.8.2 ([#259](https://github.com/stefanzweifel/git-auto-commit-action/pull/259)) [@dependabot](https://github.com/@dependabot)
- Bump actions/checkout from 2 to 3 ([#257](https://github.com/stefanzweifel/git-auto-commit-action/pull/257)) [@dependabot](https://github.com/@dependabot)
## [v4.15.3](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.2...v4.15.3) - 2022-10-26
### Changed
- Use deprecated set-output syntax if GITHUB_OUTPUT environment is not available ([#255](https://github.com/stefanzweifel/git-auto-commit-action/pull/255)) [@stefanzweifel](https://github.com/@stefanzweifel)
## [v4.15.2](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.1...v4.15.2) - 2022-10-22
### Changed
- Replace set-output usage with GITHUB_OUTPUT ([#252](https://github.com/stefanzweifel/git-auto-commit-action/pull/252)) [@amonshiz](https://github.com/amonshiz)
## [v4.15.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.15.0...v4.15.1) - 2022-10-10
### Fixed
- Run Action on Node16 ([#247](https://github.com/stefanzweifel/git-auto-commit-action/pull/247)) [@stefanzweifel](https://github.com/@stefanzweifel)
## [v4.15.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.14.1...v4.15.0) - 2022-09-24
### Changed
- Expand `file_pattern`-input to an array ([#205](https://github.com/stefanzweifel/git-auto-commit-action/pull/205)) [@stefanzweifel](https://github.com/@stefanzweifel)
### Fixed
- String values in README.md extended example are now correct ([#196](https://github.com/stefanzweifel/git-auto-commit-action/pull/196)) [@karolswdev](https://github.com/@karolswdev)
- Fix Typos and grammer Errors in README ([#235](https://github.com/stefanzweifel/git-auto-commit-action/pull/235)) [@derrickleemy](https://github.com/@derrickleemy)
- Fix Typo in README ([#230](https://github.com/stefanzweifel/git-auto-commit-action/pull/230)) [@fty4](https://github.com/@fty4)
- Add missing links in the CHANGELOG ([#223](https://github.com/stefanzweifel/git-auto-commit-action/pull/223)) [@ericcornelissen](https://github.com/@ericcornelissen)
## [v4.14.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.14.0...v4.14.1) - 2022-04-12
## Changed
- Change Commit User Name from "GitHub Actions" to "github-actions[bot]" ([#213](https://github.com/stefanzweifel/git-auto-commit-action/pull/213)) @jooola
- Change Commit User Email from "actions@github.com" to "github-actions[bot]@users.noreply.github.com" ([#213](https://github.com/stefanzweifel/git-auto-commit-action/pull/213)) @jooola
## Fixed
- Update doc link to GITHUB_TOKEN not triggering new workflow runs ([#206](https://github.com/stefanzweifel/git-auto-commit-action/pull/206)) @gapple
## [v4.14.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.13.1...v4.14.0) - 2022-03-18
## Added
- Add `create_branch` option to force create a new branch ([#203](https://github.com/stefanzweifel/git-auto-commit-action/pull/203)) @stefanzweifel
## Fixed
- README.md: Updates hyperlink to GH docs ([#200](https://github.com/stefanzweifel/git-auto-commit-action/pull/200)) @funkyfuture
## [v4.13.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.13.0...v4.13.1) - 2022-01-13
## Fixed
- Properly disambiguate between branch or file checkout ([#199](https://github.com/stefanzweifel/git-auto-commit-action/pull/199)) @kenodegard
## [v4.13.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.12.0...v4.13.0) - 2022-01-10
## Added
- Add `skip_checkout` option ([#197](https://github.com/stefanzweifel/git-auto-commit-action/pull/197)) @cmbuckley
## Changed
- Add note on minimum permissions to the docs ([#180](https://github.com/stefanzweifel/git-auto-commit-action/pull/180)) @ericcornelissen
## [v4.12.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.11.0...v4.12.0) - 2021-09-10
### Added
- Add `commit_hash` output [#172](https://github.com/stefanzweifel/git-auto-commit-action/pull/172)
## [v4.11.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.10.0...v4.11.0) - 2021-05-03
### Added
- Add `status_options` and `add_options` option [#156](https://github.com/stefanzweifel/git-auto-commit-action/pull/156)
## [v4.10.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.2...v4.10.0) - 2021-04-12
### Added
- Add `disable_globbing` option [#153](https://github.com/stefanzweifel/git-auto-commit-action/issues/153), [#154](https://github.com/stefanzweifel/git-auto-commit-action/pull/154)
## [v4.9.2](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.1...v4.9.2) - 2021-03-04
### Fixes
- Push created annotated tags to remote by using `--follow-tags` and `--atomic` instead of just `--tags` [#146](https://github.com/stefanzweifel/git-auto-commit-action/pull/146)
## [v4.9.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.0...v4.9.1) - 2021-02-23
### Changed
- Revert changes made in v4.9.0. A branch will no longer be automatically generated. [#144](https://github.com/stefanzweifel/git-auto-commit-action/pull/144)
## [v4.9.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.8.0...v4.9.0) - 2021-02-20
### Changed
- Automatically create branch if a branch with the given name does not exist [#140](https://github.com/stefanzweifel/git-auto-commit-action/pull/140)
## [v4.8.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.7.2...v4.8.0) - 2020-12-15
### Added
- Add `skip_fetch` option to skip the execution of `git-fetch` [#131](https://github.com/stefanzweifel/git-auto-commit-action/pull/131)
### Changed
- Update `git fetch` to only fetch the latest commit from remote [#131](https://github.com/stefanzweifel/git-auto-commit-action/pull/131)
## [v4.7.2](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.7.1...v4.7.2) - 2020-10-24
This release basically reverts the Action to the state of `v4.6.0`.
### Changed
- Revert change to fix git-checkout with special characters in branch names [#122](https://github.com/stefanzweifel/git-auto-commit-action/pull/122)
## [v4.7.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.7.0...v4.7.1) - 2020-10-22
### Removed
- Remove `checkout_options` as it broke everything [#120](https://github.com/stefanzweifel/git-auto-commit-action/pull/120/)
## [v4.7.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.6.0...v4.7.0) - 2020-10-21
### Added
- Add `checkout_options` [#115](https://github.com/stefanzweifel/git-auto-commit-action/pull/115)
## [v4.6.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.5.1...v4.6.0) - 2020-10-11
### Changed
- Make "commit_message" optional and set default commit message to "Apply automatic changes" [#103](https://github.com/stefanzweifel/git-auto-commit-action/issues/103), [#110](https://github.com/stefanzweifel/git-auto-commit-action/pull/110)
### Fixes
- Better support for branch names with special characters in them [#108](https://github.com/stefanzweifel/git-auto-commit-action/pull/108)
## [v4.5.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.5.0...v4.5.1) - 2020-09-11
### Removed
- Remove orphan branch feature added in #95 which broke stuff [#98](https://github.com/stefanzweifel/git-auto-commit-action/pull/98)
## [v4.5.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.4.1...v4.5.0) - 2020-09-10
### Added
- Create orphan branch if branch name does not exist [#95](https://github.com/stefanzweifel/git-auto-commit-action/pull/95)
## [v4.4.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.4.0...v4.4.1) - 2020-08-16
### Changed
- Include given `file_pattern` in git dirty check [#91](https://github.com/stefanzweifel/git-auto-commit-action/pull/91)
## [v4.4.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.3.0...v4.4.0) - 2020-06-26
### Added
- Add option to skipt the dirty check and always try to create and push a commit [#82](https://github.com/stefanzweifel/git-auto-commit-action/issues/82), [#84](https://github.com/stefanzweifel/git-auto-commit-action/pull/84)
## [v4.3.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.2.0...v4.3.0) - 2020-05-16
Note: Since v4.3.0 we provide major version tags. You can now use `stefanzweifel/git-auto-commit-action@v4` to always use the latest release of a major version. See [#77](https://github.com/stefanzweifel/git-auto-commit-action/issues/77) for details.
### Added
- Add new `push_options`-input. This feature makes it easier for you to force-push commits to a repository. [#78](https://github.com/stefanzweifel/git-auto-commit-action/pull/78), [#72](https://github.com/stefanzweifel/git-auto-commit-action/issues/72)
## [v4.2.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.6...v4.2.0) - 2020-05-10
### Changed
- Use `${{ github.head_ref }}` as default branch value. Therefore, the branch name when listening for `pull_request`-events is optional. [#75](https://github.com/stefanzweifel/git-auto-commit-action/pull/75), [#73](https://github.com/stefanzweifel/git-auto-commit-action/pull/73)
## [v4.1.6](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.5...v4.1.6) - 2020-04-28
### Fixes
- Fix issue where tags could not be created correctly [#68](https://github.com/stefanzweifel/git-auto-commit-action/pull/68)
## [v4.1.5](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.4...v4.1.5) - 2020-04-23
### Added
- Update `file_pattern` to support multiple file paths [#65](https://github.com/stefanzweifel/git-auto-commit-action/pull/65)
### Changes
- Revert changes made in v4.1.4 [#63](https://github.com/stefanzweifel/git-auto-commit-action/pull/63)
### Fixes
- Fix issue with `commit_options` [#64](https://github.com/stefanzweifel/git-auto-commit-action/pull/64)
## [v4.1.4](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.3...v4.1.4) - 2020-04-22
### Fixed
- Fix bug introduced in previous version, where git user configuration has been placed inline [#62](https://github.com/stefanzweifel/git-auto-commit-action/pull/62)
## [v4.1.3](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.2...v4.1.3) - 2020-04-18
### Changed
- Place Git user configuration inline [#59](https://github.com/stefanzweifel/git-auto-commit-action/pull/59)
## [v4.1.2](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.1...v4.1.2) - 2020-04-03
### Fixes
- Fix Issue with `changes_detected`-output [#57](https://github.com/stefanzweifel/git-auto-commit-action/pull/57)
## [v4.1.1](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.1.0...v4.1.1) - 2020-03-14
### Fixes
- Fix issue where commit has not been pushed to remote repository, when no `branch`-option has been given [#54](https://github.com/stefanzweifel/git-auto-commit-action/pull/54)
## [v4.1.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.0.0...v4.1.0) - 2020-03-05
### Added
- Add `changes_detected` output [#49](https://github.com/stefanzweifel/git-auto-commit-action/pull/49), [#46](https://github.com/stefanzweifel/git-auto-commit-action/issues/46)
- Add `tagging_message` input option to create and push tags [#50](https://github.com/stefanzweifel/git-auto-commit-action/pull/50), [#47](https://github.com/stefanzweifel/git-auto-commit-action/issues/47)
## [v4.0.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v3.0.0...v4.0.0) - 2020-02-24
### Changed
- Switch Action to use `node12`-environment instead of `docker`. [#45](https://github.com/stefanzweifel/git-auto-commit-action/pull/45)
## [v3.0.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.5.0...v3.0.0) - 2020-02-06
### Added
- Add `commit_user_name`, `commit_user_email` and `commit_author` input options for full customzation on how the commit is being created [#39](https://github.com/stefanzweifel/git-auto-commit-action/pull/39)
### Changed
- Make the `branch` input option optional [#41](https://github.com/stefanzweifel/git-auto-commit-action/pull/41)
### Removed
- Remove the need of a GITHUB_TOKEN. Users now have to use `actions/checkout@v2` or higher [#36](https://github.com/stefanzweifel/git-auto-commit-action/pull/36)
## [v2.5.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.4.0...v2.5.0) - 2019-12-18
### Added
- Add new `repository`-argument [#22](https://github.com/stefanzweifel/git-auto-commit-action/pull/22)
### Changed
- Extract logic of the Action into methods and into a separate file [#24](https://github.com/stefanzweifel/git-auto-commit-action/pull/24)
## [v2.4.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.3.0...v2.4.0) - 2019-11-30
### Added
- Commit untracked files [#19](https://github.com/stefanzweifel/git-auto-commit-action/pull/19) (fixes [#16](https://github.com/stefanzweifel/git-auto-commit-action/issues/16))
- Add support for Git-LFS [#21](https://github.com/stefanzweifel/git-auto-commit-action/pull/21) (fixes [#20](https://github.com/stefanzweifel/git-auto-commit-action/issues/20))
## [v2.3.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.2.0...v2.3.0) - 2019-11-04
### Added
- Add a new `commit_option`-argument. Allows users to define additional commit options for the `git-commit` command. [#14](https://github.com/stefanzweifel/git-auto-commit-action/pull/15)
## [v2.2.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.1.0...v2.2.0) - 2019-10-26
### Added
- Add new `file_pattern`-argument. Allows users to define which files should be added in the commit. [#13](https://github.com/stefanzweifel/git-auto-commit-action/pull/13)
## [v2.1.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.0.0...v2.1.0) - 2019-09-20
### Added
- Add `branch`-argument to determine, to which branch changes should be pushed. See README for usage details.
### Fixed
- Fixes Issue where changes couldn't be pushed to GitHub due to wrong ref-name.
### Removed
- Remove `commit_author_email` and `commit_author_name` arguments. The `$GITHUB_ACTOR` is now used as the Git Author
- Remove `commit_author_email` and `commit_author_name` arguments. The `$GITHUB_ACTOR` is now used as the Git Author
## [v2.0.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v1.0.0...v2.0.0) - 2019-08-31
### Changed
- Make Action Compatible with latest beta of GitHub Actions [#3](https://github.com/stefanzweifel/git-auto-commit-action/pull/3)
- Make Action Compatible with latest beta of GitHub Actions [#3](https://github.com/stefanzweifel/git-auto-commit-action/pull/3)
## v1.0.0 - 2019-06-10
### Added
- Add Core Logic for Action

View File

@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at hello@stefanzweifel.io. All
reported by contacting the project team at stefan@stefanzweifel.dev. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.

View File

@ -1,16 +0,0 @@
FROM alpine/git:1.0.7
LABEL "com.github.actions.name"="Auto Commit changed files"
LABEL "com.github.actions.description"="Automatically commits files which have been changed during the workflow run and push changes back to remote repository."
LABEL "com.github.actions.icon"="git-commit"
LABEL "com.github.actions.color"="orange"
LABEL "repository"="http://github.com/stefanzweifel/git-auto-commit-action"
LABEL "homepage"="http://github.com/stefanzweifel/git-auto-commit-action"
LABEL "maintainer"="Stefan Zweifel <hello@stefanzweifel.io>"
RUN apk add git-lfs
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["sh", "/entrypoint.sh"]

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2019 Stefan Zweifel
Copyright (c) 2021 Stefan Zweifel
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

466
README.md
View File

@ -1,85 +1,475 @@
# git-auto-commit-action
# git-auto-commit Action
This GitHub Action automatically commits files which have been changed during a Workflow run and pushes the Commit back to GitHub.
The Committer is "GitHub Actions <actions@github.com>" and the Author of the Commit is "Your GitHub Username <github_username@users.noreply.github.com>.
> The GitHub Action for committing files for the 80% use case.
If no changes are available, the Actions does nothing.
<a href="https://github.com/stefanzweifel/git-auto-commit-action/actions?query=workflow%3Atests">
<img src="https://github.com/stefanzweifel/git-auto-commit-action/workflows/tests/badge.svg" alt="">
</a>
This Action has been inspired and adapted from the [auto-commit](https://github.com/cds-snc/github-actions/tree/master/auto-commit
)-Action of the Canadian Digital Service and the [commit](https://github.com/elstudio/actions-js-build/blob/41d604d6e73d632e22eac40df8cc69b5added04b/commit/entrypoint.sh)-Action by Eric Johnson.
A GitHub Action to detect changed files during a Workflow run and to commit and push them back to the GitHub repository.
By default, the commit is made in the name of "GitHub Actions" and co-authored by the user that made the last commit.
If you want to learn more how this Action works under the hood, check out [this article](https://michaelheap.com/git-auto-commit/) by Michael Heap.
## Usage
Add the following step at the end of your job.
Adding git-auto-commit to your Workflow only takes a couple lines of code.
1. Set the `contents`-permission of the default GITHUB_TOKEN to `true`. (Required to push new commits to the repository)
2. Add the following step at the end of your job, after other steps that might add or change files.
```yaml
- uses: stefanzweifel/git-auto-commit-action@v2.3.0
with:
commit_message: Apply automatic changes
branch: ${{ github.head_ref }}
# Optional git params
commit_options: '--no-verify --signoff'
# Optional glob pattern of files which should be added to the commit
file_pattern: src/\*.js
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: stefanzweifel/git-auto-commit-action@v5
```
You **do not** have to create a new secret called `GITHUB_TOKEN` in your repository. `GITHUB_TOKEN` is a special token GitHub creates automatically during an Action run. (See [the documentation](https://help.github.com/en/articles/virtual-environments-for-github-actions#creating-and-using-secrets-encrypted-variables) for details)
Your Workflow should look similar to this example.
The Action will only commit files back, if changes are available. The resulting commit **will not trigger** another GitHub Actions Workflow run!
```yaml
name: Format
It is recommended to use this Action in Workflows which listen to the `pull_request` event. If you want to use the Action on other events, you have to hardcode the value for `branch` as `github.head_ref` is only available in Pull Requests.
on: push
## Example Usage
jobs:
format-code:
runs-on: ubuntu-latest
This Action will only work, if the job in your workflow changes project files.
The most common use case for this, is when you're running a Linter or Code-Style fixer on GitHub Actions.
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the
# added or changed files to the repository.
contents: write
In this example I'm running `php-cs-fixer` in a PHP project.
steps:
- uses: actions/checkout@v4
# Other steps that change files in the repository
# Commit all changed files back to the repository
- uses: stefanzweifel/git-auto-commit-action@v5
```
> [!NOTE]
> The Action has to be used in a Job that runs on a UNIX system (e.g. `ubuntu-latest`).
The following is an extended example with all available options.
```yaml
- uses: stefanzweifel/git-auto-commit-action@v5
with:
# Optional. Commit message for the created commit.
# Defaults to "Apply automatic changes"
commit_message: Automated Change
# Optional. Remote branch name where commit is going to be pushed to.
# Defaults to the current branch.
branch: feature-123
# Optional. Options used by `git-commit`.
# See https://git-scm.com/docs/git-commit#_options
commit_options: '--no-verify --signoff'
# Optional glob pattern of files which should be added to the commit
# Defaults to all (.)
# See the `pathspec`-documentation for git
# - https://git-scm.com/docs/git-add#Documentation/git-add.txt-ltpathspecgt82308203
# - https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec
file_pattern: '*.php src/*.js tests/*.js'
# Optional. Local file path to the repository.
# Defaults to the root of the repository.
repository: .
# Optional commit user and author settings
commit_user_name: My GitHub Actions Bot # defaults to "github-actions[bot]"
commit_user_email: my-github-actions-bot@example.org # defaults to "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: Author <actions@github.com> # defaults to author of the commit that triggered the run
# Optional. Tag name being created in the local repository and
# pushed to remote repository and defined branch.
tagging_message: 'v1.0.0'
# Optional. Option used by `git-status` to determine if the repository is
# dirty. See https://git-scm.com/docs/git-status#_options
status_options: '--untracked-files=no'
# Optional. Options used by `git-add`.
# See https://git-scm.com/docs/git-add#_options
add_options: '-u'
# Optional. Options used by `git-push`.
# See https://git-scm.com/docs/git-push#_options
push_options: '--force'
# Optional. Disable dirty check and always try to create a commit and push
skip_dirty_check: true
# Optional. Prevents the shell from expanding filenames.
# Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html
disable_globbing: true
```
Please note that the Action depends on `bash`. If you're using the Action in a job in combination with a custom Docker container, make sure that `bash` is installed.
## Example Workflow
In this example, we're running `php-cs-fixer` in a PHP project to fix the codestyle automatically, then commit possible changed files back to the repository.
Note that we explicitly specify `${{ github.head_ref }}` in the checkout Action.
This is required in order to work with the `pull_request` event (or any other non-`push` event).
```yaml
name: php-cs-fixer
on:
pull_request:
paths:
- '**.php'
push:
branches:
- main
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
permissions:
# Give the default GITHUB_TOKEN write permission to commit and push the changed files back to the repository.
contents: write
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
with:
fetch-depth: 1
ref: ${{ github.head_ref }}
- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v2.3.0
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply php-cs-fixer changes
branch: ${{ github.head_ref }}
file_pattern: src/\*.php
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
### Inputs
## Inputs
Checkout [`action.yml`](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/action.yml) for a full list of supported inputs.
## Outputs
You can use these outputs to trigger other Actions in your Workflow run based on the result of `git-auto-commit-action`.
- `changes_detected`: Returns either "true" or "false" if the repository was dirty and files have changed.
- `commit_hash`: Returns the full hash of the commit if one was created.
### Example
```yaml
- name: "Run if changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'true'
run: echo "Changes!"
- name: "Run if no changes have been detected"
if: steps.auto-commit-action.outputs.changes_detected == 'false'
run: echo "No Changes!"
```
## Limitations & Gotchas
The goal of this Action is to be "the Action for committing files for the 80% use case". Therefore, you might run into issues if your Workflow falls into the not supported 20% portion.
The following is a list of edge cases the Action knowingly does not support:
**No `git pull` when the repository is out of date with remote.** The Action will not do a `git pull` before doing the `git push`. **You** are responsible for keeping the repository up to date in your Workflow runs.
**No support for running the Action in build matrices**. If your Workflow is using build matrices, and you want that each job commits and pushes files to the remote, you will run into the issue, that the repository in the workflow will become out of date. As the Action will not do a `git pull` for you, you have to do that yourself.
**No support for `git rebase` or `git merge`**. There are many strategies on how to integrate remote upstream changes to a local repository. `git-auto-commit` does not want to be responsible for doing that.
**No support for detecting line break changes between CR (Carriage Return) and LF (Line Feed)**. This is a low level issue, you have to resolve differently in your project. Sorry.
If this Action doesn't work for your workflow, check out [EndBug/add-and-commit](https://github.com/EndBug/add-and-commit).
### Checkout the correct branch
You must use `action/checkout@v2` or later versions to check out the repository.
In non-`push` events, such as `pull_request`, make sure to specify the `ref` to check out:
```yaml
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
```
Do this to avoid checking out the repository in a detached state.
### Commits made by this Action do not trigger new Workflow runs
The resulting commit **will not trigger** another GitHub Actions Workflow run.
This is due to [limitations set by GitHub](https://docs.github.com/en/actions/security-guides/automatic-token-authentication#using-the-github_token-in-a-workflow).
> When you use the repository's GITHUB_TOKEN to perform tasks on behalf of the GitHub Actions app, events triggered by the GITHUB_TOKEN will not create a new workflow run. This prevents you from accidentally creating recursive workflow runs.
You can change this by creating a new [Personal Access Token (PAT)](https://github.com/settings/tokens/new),
storing the token as a secret in your repository and then passing the new token to the [`actions/checkout`](https://github.com/actions/checkout#usage) Action step.
```yaml
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
```
If you create a personal access token, apply the `repo` and `workflow` scopes.
If you work in an organization and don't want to create a PAT from your personal account, we recommend using a [robot account](https://docs.github.com/en/github/getting-started-with-github/types-of-github-accounts) for the token.
### Change to file is not detected
Does your workflow change a file, but "git-auto-commit" does not detect the change? Check the `.gitignore` that applies to the respective file. You might have accidentally marked the file to be ignored by git.
## Advanced Uses
### Multiline Commit Messages
If your commit message should span multiple lines, you have to create a separate step to generate the string.
The example below can be used as a starting point to generate a multiline commit meesage. Learn more how multiline strings in GitHub Actions work in the [GitHub documentation](https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#multiline-strings).
```yaml
# Building a multiline commit message
# Adjust to your liking
- run: echo "Commit Message 1" >> commitmessage.txt
- run: echo "Commit Message 2" >> commitmessage.txt
- run: echo "Commit Message 3" >> commitmessage.txt
# Create a multiline string to be used by the git-auto-commit Action
- name: Set commit message
id: commit_message_step
run: |
echo 'commit_message<<EOF' >> $GITHUB_OUTPUT
cat commitmessage.txt >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
# Quick and dirty step to get rid of the temporary file holding the commit message
- run: rm -rf commitmessage.txt
- uses: stefanzweifel/git-auto-commit-action@v5
id: commit
with:
commit_message: ${{ steps.commit_message_step.outputs.commit_message }}
```
### Signing Commits & Other Git Command Line Options
Using command lines options needs to be done manually for each workflow which you require the option enabled. So for example signing commits requires you to import the gpg signature each and every time. The following list of actions are worth checking out if you need to automate these tasks regularly.
- [Import GPG Signature](https://github.com/crazy-max/ghaction-import-gpg) (Suggested by [TGTGamer](https://github.com/tgtgamer))
### Use in forks from private repositories
By default, GitHub Actions doesn't run Workflows on forks from **private** repositories. To enable Actions for **private** repositories enable "Run workflows from pull requests" in your repository settings.
See [this announcement from GitHub](https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/) or the [GitHub docs](https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#enabling-workflows-for-private-repository-forks) for details.
### Use in forks from public repositories
> [!NOTE]
> This Action technically works with forks. However, please note that the combination of triggers and their options can cause issues. Please read [the documentation](https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows) on which triggers GitHub Actions support.\
> Ensure your contributors enable "Allow edits by maintainers" when opening a pull request. ([Learn more](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork)) \
> \
> **If you use this Action in combination with a linter/fixer, it's easier if you run the Action on `push` on your `main`-branch.**
> [!WARNING]
> Due to limitations of GitHub, this Action currently can't push commits to a base repository, if the fork _lives_ under an organisation. See [github/community#6634](https://github.com/orgs/community/discussions/5634) and [this comment](https://github.com/stefanzweifel/git-auto-commit-action/issues/211#issuecomment-1428849944) for details.
By default, this Action will not run on Pull Requests which have been opened by forks. (This is a limitation by GitHub, not by us.)
However, there are a couple of ways to use this Actions in Workflows that should be triggered by forked repositories.
### Workflow should run in **base** repository
> [!CAUTION]
> The following section explains how you can use git-auto-commit in combination with the `pull_request_target` trigger.
> **Using `pull_request_target` in your workflows can lead to repository compromise as [mentioned](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/) by GitHub's own security team. This means, that a bad actor could potentially leak/steal your GitHub Actions repository secrets.**
> Please be aware of this risk when using `pull_request_target` in your workflows.
>
> If your workflow runs code-fixing tools, consider running the workflow on your default branch by listening to the `push` event or use a third-party tool like [autofix.ci](https://autofix.ci/).
> We keep this documentation around, as many questions came in over the years, on how to use this action for public forks.
The workflow below runs whenever a commit is pushed to the `main`-branch or when activity on a pull request happens, by listening to the [`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target) event.
If the workflow is triggered by the `pull_request_target`-event, the workflow will run in the context of the base of the pull request, rather than in the context of the merge commit, as the `pull_request` event does.
In other words, this will allow your workflow to be run in the repository where the pull request is opened to and will push changes back to the fork.
Check out the discussion in [#211](https://github.com/stefanzweifel/git-auto-commit-action/issues/211) for more information on this.
```yaml
name: Format PHP
on:
push:
branches:
- main
pull_request_target:
jobs:
php-cs-fixer:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
# Checkout the fork/head-repository and push changes to the fork.
# If you skip this, the base repository will be checked out and changes
# will be committed to the base repository!
repository: ${{ github.event.pull_request.head.repo.full_name }}
# Checkout the branch made in the fork. Will automatically push changes
# back to this branch.
ref: ${{ github.head_ref }}
- name: Run php-cs-fixer
uses: docker://oskarstark/php-cs-fixer-ga
- uses: stefanzweifel/git-auto-commit-action@v5
```
For more information about running Actions on forks, see [this announcement from GitHub](https://github.blog/2020-08-03-github-actions-improvements-for-fork-and-pull-request-workflows/).
### Using `--amend` and `--no-edit` as commit options
If you would like to use this Action to create a commit using [`--amend`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---amend) and [`--no-edit`](https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---no-edit) you need to make some adjustments.
> [!CAUTION]
> You should understand the implications of rewriting history if you amend a commit that has already been published. [See rebasing](https://git-scm.com/docs/git-rebase#_recovering_from_upstream_rebase).
First, you need to extract the previous commit message by using `git log -1 --pretty=%s`.
Then you need to provide this last commit message to the Action through the `commit_message` input option.
Finally, you have to use `push_options: '--force'` to overwrite the git history on the GitHub remote repository. (git-auto-commit will not do a `git-rebase` for you!)
The steps in your workflow might look like this:
```yaml
- uses: actions/checkout@4
with:
# Fetch the last 2 commits instead of just 1. (Fetching just 1 commit would overwrite the whole history)
fetch-depth: 2
# Other steps in your workflow to trigger a changed file
- name: Get last commit message
id: last-commit-message
run: |
echo "msg=$(git log -1 --pretty=%s)" >> $GITHUB_OUTPUT
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ${{ steps.last-commit-message.outputs.msg }}
commit_options: '--amend --no-edit'
push_options: '--force'
```
See discussion in [#159](https://github.com/stefanzweifel/git-auto-commit-action/issues/159#issuecomment-845347950) for details.
## Troubleshooting
### Action does not push commit to repository
Make sure to [checkout the correct branch](#checkout-the-correct-branch).
### Action does not push commit to repository: Authentication Issue
If your Workflow can't push the commit to the repository because of authentication issues,
please update your Workflow configuration and usage of [`actions/checkout`](https://github.com/actions/checkout#usage).
Updating the `token` value with a Personal Access Token should fix your issues.
### Push to protected branches
If your repository uses [protected branches](https://help.github.com/en/github/administering-a-repository/configuring-protected-branches) you have to make some changes to your Workflow for the Action to work properly: You need a Personal Access Token and you either have to allow force pushes or the Personal Access Token needs to belong to an Administrator.
First, you have to create a new [Personal Access Token (PAT)](https://github.com/settings/tokens/new),
store the token as a secret in your repository and pass the new token to the [`actions/checkout`](https://github.com/actions/checkout#usage) Action step.
```yaml
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
```
You can learn more about Personal Access Token in the [GitHub documentation](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token).
> [!TIP]
> If you're working in an organisation, and you don't want to create the PAT from your personal account, we recommend using a bot-account for such tokens.
If you go the "force pushes" route, you have to enable force pushes to a protected branch (see [documentation](https://help.github.com/en/github/administering-a-repository/enabling-force-pushes-to-a-protected-branch)) and update your Workflow to use force push like this.
```yaml
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply php-cs-fixer changes
push_options: --force
```
### No new workflows are triggered by the commit of this action
This is due to limitations set up by GitHub, [commits made by this Action do not trigger new Workflow runs](#commits-made-by-this-action-do-not-trigger-new-workflow-runs).
### Pathspec 'x' did not match any files
If you're using the Action with a custom `file_pattern` and the Action throws a fatal error with the message "Pathspec 'file-pattern' did not match any files", the problem is probably that no file for the pattern **exists** in the repository.
`file_pattern` is used both for `git-status` and `git-add` in this Action. `git-add` will throw a fatal error, if for example, you use a file pattern like `*.js *.ts` but no `*.ts` files exist in your projects' repository.
See [Issue #227](https://github.com/stefanzweifel/git-auto-commit-action/issues/227) for details.
### Custom `file_pattern`, changed files but seeing "Working tree clean. Nothing to commit." in the logs
If you're using a custom `file_pattern` and the Action does not detect the changes made in your worfklow, you're probably running into a globbing issue.
Let's imagine you use `file_pattern: '*.md'` to detect and commit changes to all Markdown files in your repository.
If your Workflow now only updates `.md`-files in a subdirectory, but you have an untouched `.md`-file in the root of the repository, the git-auto-commit Action will display "Working tree clean. Nothing to commit." in the Workflow log.
This is due to the fact, that the `*.md`-glob is expanded before sending it to `git-status`. `git-status` will receive the filename of your untouched `.md`-file in the root of the repository and won't detect any changes; and therefore the Action does nothing.
To fix this add `disable_globbing: true` to your Workflow.
```yaml
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: '*.md'
disable_globbing: true
```
See [Issue #239](https://github.com/stefanzweifel/git-auto-commit-action/issues/239) for details.
## Running the tests
The Action has tests written in [bats](https://github.com/bats-core/bats-core). Before you can run the test suite locally, you have to install the dependencies with `npm` or `yarn`.
```shell
npm install
yarn
```
You can run the test suite with `npm` or `yarn`.
```shell
npm run test
yarn test
```
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/stefanzweifel/git-auto-commit-action/tags).
We also provide major version tags to make it easier to always use the latest release of a major version. For example, you can use `stefanzweifel/git-auto-commit-action@v5` to always use the latest release of the current major version.
(More information about this [here](https://help.github.com/en/actions/building-actions/about-actions#versioning-your-action).)
## Credits
* [Stefan Zweifel](https://github.com/stefanzweifel)
* [All Contributors](https://github.com/stefanzweifel/git-auto-commit-action/graphs/contributors)
This Action has been inspired and adapted from the [auto-commit](https://github.com/cds-snc/github-actions/tree/master/auto-commit
)-Action of the Canadian Digital Service and this [commit](https://github.com/elstudio/actions-js-build/blob/41d604d6e73d632e22eac40df8cc69b5added04b/commit/entrypoint.sh)-Action by Eric Johnson.
## License
This project is licensed under the MIT License - see the [LICENSE](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/LICENSE) file for details.

View File

@ -1,31 +1,77 @@
name: Git Auto Commit
description: 'Automatically commits files which have been changed during the workflow run and push changes back to remote repository.'
author: Stefan Zweifel <hello@stefanzweifel.io>
author: Stefan Zweifel <stefan@stefanzweifel.dev>
inputs:
commit_message:
description: Commit message
required: true
commit_options:
description: Commit options
required: false
default: Apply automatic changes
branch:
description: Branch where changes should be pushed too
required: true
description: Git branch name, where changes should be pushed too. Required if Action is used on the `pull_request` event
required: false
default: ${{ github.head_ref }}
commit_options:
description: Commit options (eg. --no-verify)
required: false
default: ''
add_options:
description: Add options (eg. -u)
required: false
default: ''
status_options:
description: Status options (eg. --untracked-files=no)
required: false
default: ''
file_pattern:
description: File pattern used for "git add"
description: File pattern used for `git add`. For example `src/*.js`
required: false
default: '.'
repository:
description: Local file path to the git repository. Defaults to the current directory (`.`)
required: false
default: '.'
commit_user_name:
description: Name used for the commit user
required: false
default: github-actions[bot]
commit_user_email:
description: Email address used for the commit user
required: false
default: 41898282+github-actions[bot]@users.noreply.github.com
commit_author:
description: Value used for the commit author. Defaults to the username of whoever triggered this workflow run.
required: false
default: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
tagging_message:
description: Message used to create a new git tag with the commit. Keep this empty, if no tag should be created.
required: false
default: ''
push_options:
description: Push options (eg. --force)
required: false
default: ''
skip_dirty_check:
description: Skip the check if the git repository is dirty and always try to create a commit.
required: false
default: false
disable_globbing:
description: Stop the shell from expanding filenames (https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html)
default: false
internal_git_binary:
description: Internal use only! Path to git binary used to check if git is available. (Don't change this!)
default: git
outputs:
changes_detected:
description: Value is "true", if the repository was dirty and file changes have been detected. Value is "false", if no changes have been detected.
commit_hash:
description: Full hash of the created commit. Only present if the "changes_detected" output is "true".
runs:
using: 'docker'
image: 'Dockerfile'
args:
- ${{ inputs.commit_message }}
- ${{ inputs.commit_options }}
- ${{ inputs.branch }}
- ${{ inputs.file_pattern }}
using: 'node20'
main: 'index.js'
branding:
icon: 'git-commit'

View File

@ -1,44 +1,158 @@
#!/bin/sh
#!/bin/bash
set -eu
# Set up .netrc file with GitHub credentials
git_setup ( ) {
cat <<- EOF > $HOME/.netrc
machine github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
if "$INPUT_DISABLE_GLOBBING"; then
set -o noglob;
fi
machine api.github.com
login $GITHUB_ACTOR
password $GITHUB_TOKEN
EOF
chmod 600 $HOME/.netrc
_set_github_output() {
local name=${1}
local value=${2}
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"
# Check if $GITHUB_OUTPUT is available
# (Feature detection will be removed in spring 2023)
if [ -z ${GITHUB_OUTPUT+x} ]; then
echo "::set-output name=$name::$value";
else
echo "$name=$value" >> $GITHUB_OUTPUT;
fi
}
# This section only runs if there have been file changes
echo "Checking for uncommitted changes in the git working tree."
if [[ -n "$(git status -s)" ]]
then
git_setup
_log() {
local level=${1}
local message=${2}
echo "::$level::$message";
}
_main() {
_check_if_git_is_available
_switch_to_repository
if _git_is_dirty || "$INPUT_SKIP_DIRTY_CHECK"; then
_set_github_output "changes_detected" "true"
_add_files
# Check dirty state of repo again using git-diff.
# (git-diff detects better if CRLF of files changes and does NOT
# proceed, if only CRLF changes are detected. See #241 and #265
# for more details.)
if [ -n "$(git diff --staged)" ] || "$INPUT_SKIP_DIRTY_CHECK"; then
_local_commit
_tag_commit
_push_to_github
else
_set_github_output "changes_detected" "false"
echo "Working tree clean. Nothing to commit.";
fi
else
_set_github_output "changes_detected" "false"
echo "Working tree clean. Nothing to commit.";
fi
}
_check_if_git_is_available() {
if hash -- "$INPUT_INTERNAL_GIT_BINARY" 2> /dev/null; then
_log "debug" "git binary found.";
else
_log "error" "git-auto-commit could not find git binary. Please make sure git is available."
exit 1;
fi
}
_switch_to_repository() {
echo "INPUT_REPOSITORY value: $INPUT_REPOSITORY";
cd "$INPUT_REPOSITORY";
}
_git_is_dirty() {
echo "INPUT_STATUS_OPTIONS: ${INPUT_STATUS_OPTIONS}";
_log "debug" "Apply status options ${INPUT_STATUS_OPTIONS}";
echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}";
read -r -a INPUT_FILE_PATTERN_EXPANDED <<< "$INPUT_FILE_PATTERN";
# shellcheck disable=SC2086
[ -n "$(git status -s $INPUT_STATUS_OPTIONS -- ${INPUT_FILE_PATTERN_EXPANDED:+${INPUT_FILE_PATTERN_EXPANDED[@]}})" ]
}
_add_files() {
echo "INPUT_ADD_OPTIONS: ${INPUT_ADD_OPTIONS}";
_log "debug" "Apply add options ${INPUT_ADD_OPTIONS}";
echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}";
read -r -a INPUT_FILE_PATTERN_EXPANDED <<< "$INPUT_FILE_PATTERN";
# shellcheck disable=SC2086
git add ${INPUT_ADD_OPTIONS} ${INPUT_FILE_PATTERN:+"${INPUT_FILE_PATTERN_EXPANDED[@]}"};
}
_local_commit() {
echo "INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS}";
_log "debug" "Apply commit options ${INPUT_COMMIT_OPTIONS}";
# shellcheck disable=SC2206
INPUT_COMMIT_OPTIONS_ARRAY=( $INPUT_COMMIT_OPTIONS );
echo "INPUT_COMMIT_USER_NAME: ${INPUT_COMMIT_USER_NAME}";
echo "INPUT_COMMIT_USER_EMAIL: ${INPUT_COMMIT_USER_EMAIL}";
echo "INPUT_COMMIT_MESSAGE: ${INPUT_COMMIT_MESSAGE}";
echo "INPUT_COMMIT_AUTHOR: ${INPUT_COMMIT_AUTHOR}";
git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" \
commit -m "$INPUT_COMMIT_MESSAGE" \
--author="$INPUT_COMMIT_AUTHOR" \
${INPUT_COMMIT_OPTIONS:+"${INPUT_COMMIT_OPTIONS_ARRAY[@]}"};
_set_github_output "commit_hash" $(git rev-parse HEAD)
}
_tag_commit() {
echo "INPUT_TAGGING_MESSAGE: ${INPUT_TAGGING_MESSAGE}"
if [ -n "$INPUT_TAGGING_MESSAGE" ]
then
_log "debug" "Create tag $INPUT_TAGGING_MESSAGE";
git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE";
else
echo "No tagging message supplied. No tag will be added.";
fi
}
_push_to_github() {
echo "INPUT_BRANCH value: $INPUT_BRANCH";
# Switch to branch from current Workflow run
git checkout $INPUT_BRANCH
echo "INPUT_PUSH_OPTIONS: ${INPUT_PUSH_OPTIONS}";
_log "debug" "Apply push options ${INPUT_PUSH_OPTIONS}";
echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}"
# shellcheck disable=SC2206
INPUT_PUSH_OPTIONS_ARRAY=( $INPUT_PUSH_OPTIONS );
git add "${INPUT_FILE_PATTERN}"
if [ -z "$INPUT_BRANCH" ]
then
# Only add `--tags` option, if `$INPUT_TAGGING_MESSAGE` is set
if [ -n "$INPUT_TAGGING_MESSAGE" ]
then
_log "debug" "git push origin --tags";
git push origin --follow-tags --atomic ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
else
_log "debug" "git push origin";
git push origin ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
fi
echo "INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS}"
else
_log "debug" "Push commit to remote branch $INPUT_BRANCH";
git push --set-upstream origin "HEAD:$INPUT_BRANCH" --follow-tags --atomic ${INPUT_PUSH_OPTIONS:+"${INPUT_PUSH_OPTIONS_ARRAY[@]}"};
fi
}
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>" ${INPUT_COMMIT_OPTIONS:+"$INPUT_COMMIT_OPTIONS"}
git push --set-upstream origin "HEAD:$INPUT_BRANCH"
else
echo "Working tree clean. Nothing to commit."
fi
_main

34
index.js Normal file
View File

@ -0,0 +1,34 @@
/**
* Most of this code has been copied from the following GitHub Action
* to make it simpler or not necessary to install a lot of
* JavaScript packages to execute a shell script.
*
* https://github.com/ad-m/github-push-action/blob/fe38f0a751bf9149f0270cc1fe20bf9156854365/start.js
*/
const spawn = require('child_process').spawn;
const path = require("path");
const exec = (cmd, args=[]) => new Promise((resolve, reject) => {
console.log(`Started: ${cmd} ${args.join(" ")}`)
const app = spawn(cmd, args, { stdio: 'inherit' });
app.on('close', code => {
if(code !== 0){
err = new Error(`Invalid status code: ${code}`);
err.code = code;
return reject(err);
};
return resolve(code);
});
app.on('error', reject);
});
const main = async () => {
await exec('bash', [path.join(__dirname, './entrypoint.sh')]);
};
main().catch(err => {
console.error(err);
console.error(err.stack);
process.exit(err.code || -1);
})

10
package.json Normal file
View File

@ -0,0 +1,10 @@
{
"devDependencies": {
"bats": "^1.10.0",
"bats-assert": "ztombol/bats-assert",
"bats-support": "ztombol/bats-support"
},
"scripts": {
"test": "bats tests"
}
}

1079
tests/git-auto-commit.bats Normal file

File diff suppressed because it is too large Load Diff

16
yarn.lock Normal file
View File

@ -0,0 +1,16 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
bats-assert@ztombol/bats-assert:
version "0.3.0"
resolved "https://codeload.github.com/ztombol/bats-assert/tar.gz/9f88b4207da750093baabc4e3f41bf68f0dd3630"
bats-support@ztombol/bats-support:
version "0.3.0"
resolved "https://codeload.github.com/ztombol/bats-support/tar.gz/004e707638eedd62e0481e8cdc9223ad471f12ee"
bats@^1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/bats/-/bats-1.10.0.tgz#d22cb6e2d88fd39302167da237d710406d1587ce"
integrity sha512-yOQrC7npuCrN+Ic3TyjTjJlzHa0qlK3oEO6VAYPWwFeutx/GmpljIyB6uNSl/UTASyc2w4FgVuA/QMMf9OdsCw==