Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stefanzweifel/git-auto-commit-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.9.2
Choose a base ref
...
head repository: stefanzweifel/git-auto-commit-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.10.0
Choose a head ref
  • 7 commits
  • 5 files changed
  • 2 contributors

Commits on Apr 10, 2021

  1. Add failing test

    stefanzweifel committed Apr 10, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    e610a51 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f4f9aed View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    be370ec View commit details
  4. Update README

    stefanzweifel committed Apr 10, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    cfd3664 View commit details
  5. Update Comments

    stefanzweifel committed Apr 10, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    3053f48 View commit details

Commits on Apr 12, 2021

  1. Merge pull request #154 from stefanzweifel/fixes/153

    Add "disable_globbing" option to prevent shell from expanding filenames
    stefanzweifel authored Apr 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    4c05e3d View commit details
  2. Tag v4.10.0

    stefanzweifel committed Apr 12, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    48d37c1 View commit details
Showing with 55 additions and 2 deletions.
  1. +8 −1 CHANGELOG.md
  2. +4 −1 README.md
  3. +3 −0 action.yml
  4. +4 −0 entrypoint.sh
  5. +36 −0 tests/git-auto-commit.bats
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -4,10 +4,17 @@ 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.9.2...HEAD)
## [Unreleased](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.10.0...HEAD)

> TBD

## [v4.10.0](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.2...v4.10.0) - 2021-04-12

### Added
- Add `disable_globbing` option [#153](https://github.com/stefanzweifel/git-auto-commit-action/issues/153), [#154](https://github.com/stefanzweifel/git-auto-commit-action/pull/154)


## [v4.9.2](https://github.com/stefanzweifel/git-auto-commit-action/compare/v4.9.1...v4.9.2) - 2021-03-04

### Fixes
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -69,7 +69,10 @@ This is a more extended example with all possible options.
skip_dirty_check: true

# Optional: Skip internal call to `git fetch`
skip_fetch: true
skip_fetch: true

# Optional: Prevents the shell from expanding filenames. Details: https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html
disable_globbing: true
```
## Example
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -52,6 +52,9 @@ inputs:
description: Skip the call to git-fetch.
required: false
default: false
disable_globbing:
description: Stop the shell from expanding filenames (https://www.gnu.org/software/bash/manual/html_node/Filename-Expansion.html)
default: false

outputs:
changes_detected:
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -2,6 +2,10 @@

set -eu

if "$INPUT_DISABLE_GLOBBING"; then
set -o noglob;
fi

_main() {
_switch_to_repository

36 changes: 36 additions & 0 deletions tests/git-auto-commit.bats
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ setup() {
export INPUT_PUSH_OPTIONS=""
export INPUT_SKIP_DIRTY_CHECK=false
export INPUT_SKIP_FETCH=false
export INPUT_DISABLE_GLOBBING=false

# Configure Git
if [[ -z $(git config user.name) ]]; then
@@ -400,3 +401,38 @@ git_auto_commit() {

assert_equal $current_sha $remote_sha
}

@test "It does not expand wildcard glob when using INPUT_PATTERN and INPUT_DISABLE_GLOBBING in git-status and git-add" {

# Create additional files in a nested directory structure
echo "Create Additional files";
touch "${FAKE_LOCAL_REPOSITORY}"/new-file-a.py
mkdir "${FAKE_LOCAL_REPOSITORY}"/nested
touch "${FAKE_LOCAL_REPOSITORY}"/nested/new-file-b.py

# Commit changes
echo "Commit changes before running git_auto_commit";
cd "${FAKE_LOCAL_REPOSITORY}";
git add . > /dev/null;
git commit --quiet -m "Init Remote Repository";
git push origin master > /dev/null;

# Make nested file dirty
echo "foo-bar" > "${FAKE_LOCAL_REPOSITORY}"/nested/new-file-b.py;

# ---

INPUT_FILE_PATTERN="*.py"
INPUT_DISABLE_GLOBBING=true

run git_auto_commit

assert_success

assert_line "INPUT_FILE_PATTERN: *.py"
assert_line "::debug::Push commit to remote branch master"

# Assert that the updated py file has been commited.
run git status
refute_output --partial 'nested/new-file-b.py'
}