Compare commits

...

21 Commits

Author SHA1 Message Date
Stefan Zweifel
3ffeab2fe0 Tag v2.1.0 2019-09-20 21:20:34 +02:00
Stefan Zweifel
5adbb8cb3e Use GITHUB_ACTOR instead of args 2019-09-20 20:34:57 +02:00
Stefan Zweifel
97f9868da0 Rename ref to branch 2019-09-20 20:26:41 +02:00
Stefan Zweifel
8a0c95d76c Merge pull request #7 from stefanzweifel/fix-branch-checkout
Bugfix: Fix git checkout and git push commands
2019-09-20 19:50:49 +02:00
Stefan Zweifel
4c6d2819f0 Update README 2019-09-20 10:47:19 +02:00
Stefan Zweifel
7fec5eda4a Cleanup 2019-09-20 10:46:35 +02:00
Stefan Zweifel
6c17ba31a9 Output $INPUT_REF 2019-09-20 10:43:15 +02:00
Stefan Zweifel
6f1c9227f5 Fix git push command 2019-09-20 10:37:16 +02:00
Stefan Zweifel
72e2d4cb1e Fix git checkout 2019-09-20 10:33:12 +02:00
Stefan Zweifel
8cc484cbc5 Add ref argument 2019-09-20 10:30:36 +02:00
Stefan Zweifel
ed0ebb9072 Log $PUSH_BRANCH value 2019-09-20 10:19:34 +02:00
Stefan Zweifel
0b91625aed WIP 2019-09-20 10:11:50 +02:00
Stefan Zweifel
ba1c2a6047 Try to fix that push command 2019-09-20 10:08:13 +02:00
Stefan Zweifel
12282205b7 Try to fix git push 2019-09-20 10:01:27 +02:00
Stefan Zweifel
ef8610f6df Fix git push 2019-09-20 09:56:20 +02:00
Stefan Zweifel
f4fd59c4d4 Use $PUSH_BRANCH in git push command 2019-09-20 09:49:26 +02:00
Stefan Zweifel
ea88bd7cde Try to fix checkout command 2019-09-20 09:42:26 +02:00
Stefan Zweifel
80f825a9bc Update how the branch is checked out 2019-09-20 09:27:50 +02:00
Stefan Zweifel
845dc426e7 Update README.md 2019-09-06 07:34:41 +02:00
Stefan Zweifel
fcfae8cf7e Merge pull request #5 from tupaschoal/patch-1
Fix puzzled explanation on README.md
2019-09-06 07:33:37 +02:00
Tulio Leao
ef125417f8 Fix puzzled explanation on README.md 2019-09-06 02:19:37 -03:00
4 changed files with 27 additions and 19 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/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
### Changes
### Changed
- Make Action Compatible with latest beta of GitHub Actions [#3](https://github.com/stefanzweifel/git-auto-commit-action/pull/3)

View File

@@ -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.
```yaml
- uses: stefanzweifel/git-auto-commit-action@dev
- uses: stefanzweifel/git-auto-commit-action@v2.0.0
with:
commit_author_email: john.doe@example.com
commit_author_name: John Doe
commit_message: Apply automatic changes
branch: ${{ github.head_ref }}
env:
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
- `commit_author_email`: The commit message used when changes are available
- `commit_author_name`: The Commit Authors Email Address
- `commit_message`: The Commit Authors Name
- `commit_message`: The commit message used when changes are available
- `branch`: Branch name where changes should be pushed to
### Environment Variables
@@ -63,9 +61,8 @@ jobs:
- name: Commit changed files
uses: stefanzweifel/git-auto-commit-action@v2.0.0
with:
commit_author_email: hello@stefanzweifel.io
commit_author_name: Stefan Zweifel
commit_message: Apply php-cs-fixer changes
branch: ${{ github.head_ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -5,13 +5,10 @@ author: Stefan Zweifel <hello@stefanzweifel.io>
inputs:
commit_message:
description: 'Commit message'
description: Commit message
required: true
commit_author_name:
description: 'Name of the commit author'
required: true
commit_author_email:
description: 'Email address of the commit author'
branch:
description: Branch where changes should be pushed too
required: true
runs:

View File

@@ -25,14 +25,16 @@ if ! git diff --quiet
then
git_setup
echo "INPUT_BRANCH value: $INPUT_BRANCH";
# Switch to branch from current Workflow run
git checkout "${GITHUB_REF:11}"
git checkout $INPUT_BRANCH
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
echo "Working tree clean. Nothing to commit."
fi