mirror of
https://github.com/stefanzweifel/git-auto-commit-action.git
synced 2025-08-03 00:56:08 +08:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
f7e2c0f118 | ||
|
8db04fa14f | ||
|
44a415d3cb | ||
|
af9e1689a5 | ||
|
2b22ba6212 | ||
|
b1b8ae8b5c | ||
|
fb3de05451 | ||
|
284d0b78f0 | ||
|
188fc2bd58 | ||
|
65d8bdf167 | ||
|
40255153c4 | ||
|
0ef5bf58dc | ||
|
e924b16154 | ||
|
2fb839c669 | ||
|
908446c002 | ||
|
2d23a29775 | ||
|
bdc88aff2c | ||
|
ddcd35eaa8 | ||
|
760c9be2dc | ||
|
69d0349561 | ||
|
eecee2898e | ||
|
3889fd6a6c | ||
|
1ad5315ba7 | ||
|
fa043bd474 | ||
|
af33cfbb5c | ||
|
677efa2969 | ||
|
b6dcf94303 | ||
|
a65a3a47cd |
13
CHANGELOG.md
13
CHANGELOG.md
@@ -4,7 +4,18 @@ 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.2.0...HEAD)
|
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.4.0...HEAD)
|
||||||
|
|
||||||
|
## [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
|
## [v2.2.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v2.1.0...v2.2.0) - 2019-10-26
|
||||||
|
|
||||||
|
@@ -9,6 +9,8 @@ LABEL "repository"="http://github.com/stefanzweifel/git-auto-commit-action"
|
|||||||
LABEL "homepage"="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>"
|
LABEL "maintainer"="Stefan Zweifel <hello@stefanzweifel.io>"
|
||||||
|
|
||||||
|
RUN apk add git-lfs
|
||||||
|
|
||||||
COPY entrypoint.sh /entrypoint.sh
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
ENTRYPOINT ["sh", "/entrypoint.sh"]
|
ENTRYPOINT ["sh", "/entrypoint.sh"]
|
||||||
|
@@ -13,11 +13,14 @@ 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@v2.2.0
|
- uses: stefanzweifel/git-auto-commit-action@v2.3.0
|
||||||
with:
|
with:
|
||||||
commit_message: Apply automatic changes
|
commit_message: Apply automatic changes
|
||||||
branch: ${{ github.head_ref }}
|
branch: ${{ github.head_ref }}
|
||||||
|
|
||||||
|
# Optional git params
|
||||||
|
commit_options: '--no-verify --signoff'
|
||||||
|
|
||||||
# Optional glob pattern of files which should be added to the commit
|
# Optional glob pattern of files which should be added to the commit
|
||||||
file_pattern: src/\*.js
|
file_pattern: src/\*.js
|
||||||
env:
|
env:
|
||||||
@@ -59,7 +62,7 @@ jobs:
|
|||||||
uses: docker://oskarstark/php-cs-fixer-ga
|
uses: docker://oskarstark/php-cs-fixer-ga
|
||||||
|
|
||||||
- name: Commit changed files
|
- name: Commit changed files
|
||||||
uses: stefanzweifel/git-auto-commit-action@v2.2.0
|
uses: stefanzweifel/git-auto-commit-action@v2.3.0
|
||||||
with:
|
with:
|
||||||
commit_message: Apply php-cs-fixer changes
|
commit_message: Apply php-cs-fixer changes
|
||||||
branch: ${{ github.head_ref }}
|
branch: ${{ github.head_ref }}
|
||||||
@@ -71,7 +74,7 @@ jobs:
|
|||||||
|
|
||||||
### Inputs
|
### Inputs
|
||||||
|
|
||||||
Checkout [`actions.yml`](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/actions.yml) for a full list of supported inputs.
|
Checkout [`action.yml`](https://github.com/stefanzweifel/git-auto-commit-action/blob/master/action.yml) for a full list of supported inputs.
|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
|
@@ -7,6 +7,9 @@ inputs:
|
|||||||
commit_message:
|
commit_message:
|
||||||
description: Commit message
|
description: Commit message
|
||||||
required: true
|
required: true
|
||||||
|
commit_options:
|
||||||
|
description: Commit options
|
||||||
|
required: false
|
||||||
branch:
|
branch:
|
||||||
description: Branch where changes should be pushed too
|
description: Branch where changes should be pushed too
|
||||||
required: true
|
required: true
|
||||||
@@ -18,6 +21,11 @@ inputs:
|
|||||||
runs:
|
runs:
|
||||||
using: 'docker'
|
using: 'docker'
|
||||||
image: 'Dockerfile'
|
image: 'Dockerfile'
|
||||||
|
args:
|
||||||
|
- ${{ inputs.commit_message }}
|
||||||
|
- ${{ inputs.commit_options }}
|
||||||
|
- ${{ inputs.branch }}
|
||||||
|
- ${{ inputs.file_pattern }}
|
||||||
|
|
||||||
branding:
|
branding:
|
||||||
icon: 'git-commit'
|
icon: 'git-commit'
|
@@ -1,4 +1,5 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
# Set up .netrc file with GitHub credentials
|
# Set up .netrc file with GitHub credentials
|
||||||
@@ -18,10 +19,9 @@ EOF
|
|||||||
git config --global user.name "GitHub Actions"
|
git config --global user.name "GitHub Actions"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# This section only runs if there have been file changes
|
# This section only runs if there have been file changes
|
||||||
echo "Checking for uncommitted changes in the git working tree."
|
echo "Checking for uncommitted changes in the git working tree."
|
||||||
if ! git diff --quiet
|
if [[ -n "$(git status -s)" ]]
|
||||||
then
|
then
|
||||||
git_setup
|
git_setup
|
||||||
|
|
||||||
@@ -30,15 +30,13 @@ then
|
|||||||
# Switch to branch from current Workflow run
|
# Switch to branch from current Workflow run
|
||||||
git checkout $INPUT_BRANCH
|
git checkout $INPUT_BRANCH
|
||||||
|
|
||||||
if [ -z ${INPUT_FILE_PATTERN+x} ];
|
echo "INPUT_FILE_PATTERN: ${INPUT_FILE_PATTERN}"
|
||||||
then
|
|
||||||
git add .
|
|
||||||
else
|
|
||||||
echo "INPUT_FILE_PATTERN value: $INPUT_FILE_PATTERN";
|
|
||||||
git add $INPUT_FILE_PATTERN
|
|
||||||
fi
|
|
||||||
|
|
||||||
git commit -m "$INPUT_COMMIT_MESSAGE" --author="$GITHUB_ACTOR <$GITHUB_ACTOR@users.noreply.github.com>"
|
git add "${INPUT_FILE_PATTERN}"
|
||||||
|
|
||||||
|
echo "INPUT_COMMIT_OPTIONS: ${INPUT_COMMIT_OPTIONS}"
|
||||||
|
|
||||||
|
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"
|
git push --set-upstream origin "HEAD:$INPUT_BRANCH"
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user