Compare commits

...

17 Commits

Author SHA1 Message Date
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
4 changed files with 40 additions and 6 deletions

View File

@@ -4,11 +4,23 @@ 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/v4.8.0...HEAD)
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.1...HEAD)
> TBD
## [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

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

View File

@@ -13,6 +13,8 @@ By default, the commit is made in the name of "GitHub Actions" and co-authored b
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.
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, after other steps that might add or change files.
@@ -143,7 +145,7 @@ You have to do this to avoid that the `checkout`-Action clones your repository i
### Commits of this Action do not trigger new Workflow runs
The resulting commit **will not trigger** another GitHub Actions Workflow run.
This is due to [limititations set by GitHub](https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
This is due to [limitations set by GitHub](https://help.github.com/en/actions/reference/events-that-trigger-workflows#triggering-new-workflows-using-a-personal-access-token).
> 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.

View File

@@ -5,9 +5,9 @@ load '../node_modules/bats-assert/load'
setup() {
# Define Paths for local repository used during tests
export FAKE_LOCAL_REPOSITORY="${BATS_TEST_DIRNAME}/test_fake_local_repository"
export FAKE_REMOTE="${BATS_TEST_DIRNAME}/test_fake_remote_repository"
export FAKE_TEMP_LOCAL_REPOSITORY="${BATS_TEST_DIRNAME}/test_fake_temp_local_repository"
export FAKE_LOCAL_REPOSITORY="${BATS_TEST_DIRNAME}/tests_local_repository"
export FAKE_REMOTE="${BATS_TEST_DIRNAME}/tests_remote_repository"
export FAKE_TEMP_LOCAL_REPOSITORY="${BATS_TEST_DIRNAME}/tests_clone_of_remote_repository"
# Set default INPUT variables used by the GitHub Action
export INPUT_REPOSITORY="${FAKE_LOCAL_REPOSITORY}"
@@ -94,6 +94,26 @@ git_auto_commit() {
assert_line "::debug::Push commit to remote branch master"
}
@test "It detects when files have been deleted, commits changes and pushes them to the remote repository" {
rm -rf "${FAKE_LOCAL_REPOSITORY}"/remote-files1.txt
run git_auto_commit
assert_success
assert_line "INPUT_REPOSITORY value: ${INPUT_REPOSITORY}"
assert_line "::set-output name=changes_detected::true"
assert_line "INPUT_BRANCH value: master"
assert_line "INPUT_FILE_PATTERN: ."
assert_line "INPUT_COMMIT_OPTIONS: "
assert_line "::debug::Apply commit options "
assert_line "INPUT_TAGGING_MESSAGE: "
assert_line "No tagging message supplied. No tag will be added."
assert_line "INPUT_PUSH_OPTIONS: "
assert_line "::debug::Apply push options "
assert_line "::debug::Push commit to remote branch master"
}
@test "It prints a 'Nothing to commit' message in a clean repository" {
run git_auto_commit