mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-08-04 01:36:11 +08:00
Compare commits
21 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
3ffeab2fe0 | ||
|
5adbb8cb3e | ||
|
97f9868da0 | ||
|
8a0c95d76c | ||
|
4c6d2819f0 | ||
|
7fec5eda4a | ||
|
6c17ba31a9 | ||
|
6f1c9227f5 | ||
|
72e2d4cb1e | ||
|
8cc484cbc5 | ||
|
ed0ebb9072 | ||
|
0b91625aed | ||
|
ba1c2a6047 | ||
|
12282205b7 | ||
|
ef8610f6df | ||
|
f4fd59c4d4 | ||
|
ea88bd7cde | ||
|
80f825a9bc | ||
|
845dc426e7 | ||
|
fcfae8cf7e | ||
|
ef125417f8 |
16
CHANGELOG.md
16
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/)
|
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).
|
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.0.0...HEAD)
|
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.1.0...HEAD)
|
||||||
|
|
||||||
|
## [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
|
||||||
|
|
||||||
|
|
||||||
## [v2.0.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v1.0.0...v2.0.0) - 2019-08-31
|
## [v2.0.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v1.0.0...v2.0.0) - 2019-08-31
|
||||||
|
|
||||||
### Changes
|
### 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)
|
||||||
|
|
||||||
|
|
||||||
|
13
README.md
13
README.md
@@ -13,11 +13,10 @@ This Action has been inspired and adapted from the [auto-commit](https://github.
|
|||||||
Add the following step at the end of your job.
|
Add the following step at the end of your job.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: stefanzweifel/git-auto-commit-action@dev
|
- uses: stefanzweifel/git-auto-commit-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
commit_author_email: john.doe@example.com
|
|
||||||
commit_author_name: John Doe
|
|
||||||
commit_message: Apply automatic changes
|
commit_message: Apply automatic changes
|
||||||
|
branch: ${{ github.head_ref }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
@@ -29,9 +28,8 @@ The Action will only commit files back, if changes are available. The resulting
|
|||||||
|
|
||||||
The following inputs are required
|
The following inputs are required
|
||||||
|
|
||||||
- `commit_author_email`: The commit message used when changes are available
|
- `commit_message`: The commit message used when changes are available
|
||||||
- `commit_author_name`: The Commit Authors Email Address
|
- `branch`: Branch name where changes should be pushed to
|
||||||
- `commit_message`: The Commit Authors Name
|
|
||||||
|
|
||||||
### Environment Variables
|
### Environment Variables
|
||||||
|
|
||||||
@@ -63,9 +61,8 @@ jobs:
|
|||||||
- name: Commit changed files
|
- name: Commit changed files
|
||||||
uses: stefanzweifel/git-auto-commit-action@v2.0.0
|
uses: stefanzweifel/git-auto-commit-action@v2.0.0
|
||||||
with:
|
with:
|
||||||
commit_author_email: hello@stefanzweifel.io
|
|
||||||
commit_author_name: Stefan Zweifel
|
|
||||||
commit_message: Apply php-cs-fixer changes
|
commit_message: Apply php-cs-fixer changes
|
||||||
|
branch: ${{ github.head_ref }}
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
@@ -5,13 +5,10 @@ author: Stefan Zweifel <hello@stefanzweifel.io>
|
|||||||
|
|
||||||
inputs:
|
inputs:
|
||||||
commit_message:
|
commit_message:
|
||||||
description: 'Commit message'
|
description: Commit message
|
||||||
required: true
|
required: true
|
||||||
commit_author_name:
|
branch:
|
||||||
description: 'Name of the commit author'
|
description: Branch where changes should be pushed too
|
||||||
required: true
|
|
||||||
commit_author_email:
|
|
||||||
description: 'Email address of the commit author'
|
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
|
@@ -25,14 +25,16 @@ if ! git diff --quiet
|
|||||||
then
|
then
|
||||||
git_setup
|
git_setup
|
||||||
|
|
||||||
|
echo "INPUT_BRANCH value: $INPUT_BRANCH";
|
||||||
|
|
||||||
# Switch to branch from current Workflow run
|
# Switch to branch from current Workflow run
|
||||||
git checkout "${GITHUB_REF:11}"
|
git checkout $INPUT_BRANCH
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
|
|
||||||
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$INPUT_COMMIT_AUTHOR_NAME <$INPUT_COMMIT_AUTHOR_EMAIL>"
|
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>"
|
||||||
|
|
||||||
git push --set-upstream origin "${GITHUB_REF:11}"
|
git push --set-upstream origin "HEAD:$INPUT_BRANCH"
|
||||||
else
|
else
|
||||||
echo "Working tree clean. Nothing to commit."
|
echo "Working tree clean. Nothing to commit."
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user