mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-07-30 06:26:12 +08:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
296e083b4c | ||
|
871ade1c45 | ||
|
75625df4f3 | ||
|
3870982ac5 | ||
|
268ec0c240 | ||
|
9abc4c41e5 | ||
|
1aee6e6b46 | ||
|
94941cff88 | ||
|
7507738fca | ||
|
53438d58ce | ||
|
8056699617 | ||
|
520c63c171 | ||
|
a6006229e0 | ||
|
40b55695d1 | ||
|
8f33b6cc31 | ||
|
c4ab3ecb7e | ||
|
350754fe3a |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -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
|
||||
|
2
LICENSE
2
LICENSE
@@ -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
|
||||
|
@@ -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.
|
||||
|
||||
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user