Skip to content

Commit

Permalink
feat: sync with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
sparanoid committed Nov 6, 2023
1 parent e8f94e4 commit bbba269
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
# Full git history is needed to get a proper list of changed files within `super-linter`
fetch-depth: 0

- name: Lint Code Base
uses: github/super-linter@v5
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
latest-version: ${{ github.event.release.name }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v5
uses: signcl/git-auto-commit-action@master
with:
branch: master
commit_message: Update CHANGELOG
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ inputs:
description: Commit options (eg. --no-verify)
required: false
default: ''
tagging_options:
description: Tagging options (eg. -s)
required: false
default: ''
add_options:
description: Add options (eg. -u)
required: false
Expand Down
11 changes: 10 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,12 +144,21 @@ _local_commit() {
}

_tag_commit() {
echo "INPUT_TAGGING_OPTIONS: ${INPUT_TAGGING_OPTIONS}";
echo "::debug::Apply tagging options ${INPUT_TAGGING_OPTIONS}";

INPUT_TAGGING_OPTIONS_ARRAY=( $INPUT_TAGGING_OPTIONS );

echo "INPUT_TAGGING_MESSAGE: ${INPUT_TAGGING_MESSAGE}"

if [ -n "$INPUT_TAGGING_MESSAGE" ]
then
_log "debug" "Create tag $INPUT_TAGGING_MESSAGE";
git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE";
# git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE";

git -c user.name="$INPUT_COMMIT_USER_NAME" -c user.email="$INPUT_COMMIT_USER_EMAIL" \
tag -a "$INPUT_TAGGING_MESSAGE" -m "$INPUT_TAGGING_MESSAGE" \
${INPUT_TAGGING_OPTIONS:+"${INPUT_TAGGING_OPTIONS_ARRAY[@]}"};
else
echo "No tagging message supplied. No tag will be added.";
fi
Expand Down
3 changes: 3 additions & 0 deletions tests/git-auto-commit.bats
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ setup() {
export INPUT_COMMIT_MESSAGE="Commit Message"
export INPUT_BRANCH="${FAKE_DEFAULT_BRANCH}"
export INPUT_COMMIT_OPTIONS=""
export INPUT_TAGGING_OPTIONS=""
export INPUT_ADD_OPTIONS=""
export INPUT_STATUS_OPTIONS=""
export INPUT_FILE_PATTERN="."
Expand Down Expand Up @@ -117,6 +118,7 @@ cat_github_output() {
assert_line "INPUT_BRANCH value: ${FAKE_DEFAULT_BRANCH}"
assert_line "INPUT_FILE_PATTERN: ."
assert_line "INPUT_COMMIT_OPTIONS: "
assert_line "INPUT_TAGGING_OPTIONS: "
assert_line "::debug::Apply commit options "
assert_line "INPUT_TAGGING_MESSAGE: "
assert_line "No tagging message supplied. No tag will be added."
Expand All @@ -140,6 +142,7 @@ cat_github_output() {
assert_line "INPUT_BRANCH value: ${FAKE_DEFAULT_BRANCH}"
assert_line "INPUT_FILE_PATTERN: ."
assert_line "INPUT_COMMIT_OPTIONS: "
assert_line "INPUT_TAGGING_OPTIONS: "
assert_line "::debug::Apply commit options "
assert_line "INPUT_TAGGING_MESSAGE: "
assert_line "No tagging message supplied. No tag will be added."
Expand Down

0 comments on commit bbba269

Please sign in to comment.